| | |
| | | <result property="updateBy" column="update_by" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="remark" column="remark" /> |
| | | <result property="nameEn" column="name_en" /> |
| | | <result property="signatureUrl" column="signature_url" /> |
| | | <result property="pictureUrl" column="picture_url" /> |
| | | <result property="company" column="company" /> |
| | | <association property="dept" javaType="SysDept" resultMap="deptResult" /> |
| | | <collection property="roles" javaType="java.util.List" resultMap="RoleResult" /> |
| | | </resultMap> |
| | |
| | | </resultMap> |
| | | |
| | | <sql id="selectUserVo"> |
| | | select u.id, u.dept_id, u.account, u.name, u.email, u.avatar, u.phone, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, |
| | | select u.id, u.dept_id, u.account, u.name, u.email, u.picture_url, u.phone, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, u.name_en, u.signature_url, u.company, |
| | | d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status, |
| | | r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status |
| | | from user u |
| | | left join sys_dept d on u.dept_id = d.dept_id |
| | | left join user_role ur on u.id = ur.user_id |
| | | left join sys_user_role ur on u.id = ur.user_id |
| | | left join sys_role r on r.role_id = ur.role_id |
| | | </sql> |
| | | |
| | | <select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult"> |
| | | select u.id, u.dept_id, u.name, u.account, u.email, u.avatar, u.phone, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from user u |
| | | select u.id, u.dept_id, u.name, u.account, u.email, u.picture_url, u.phone, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from user u |
| | | left join sys_dept d on u.dept_id = d.dept_id |
| | | where u.del_flag = '0' |
| | | <if test="userId != null and userId != 0"> |
| | |
| | | </if> |
| | | <if test="userName != null and userName != ''"> |
| | | AND u.account like concat('%', #{userName}, '%') |
| | | </if> |
| | | <if test="nickName != null and nickName != ''"> |
| | | AND u.name like concat('%', #{nickName}, '%') |
| | | </if> |
| | | <if test="status != null and status != ''"> |
| | | AND u.status = #{status} |
| | |
| | | select distinct u.id, u.dept_id, u.account, u.name, u.email, u.phone, u.status, u.create_time |
| | | from user u |
| | | left join sys_dept d on u.dept_id = d.dept_id |
| | | left join user_role ur on u.id = ur.user_id |
| | | left join sys_user_role ur on u.id = ur.user_id |
| | | left join sys_role r on r.role_id = ur.role_id |
| | | where u.del_flag = '0' and r.role_id = #{roleId} |
| | | <if test="userName != null and userName != ''"> |
| | |
| | | select distinct u.id, u.dept_id, u.account, u.name, u.email, u.phone, u.status, u.create_time |
| | | from user u |
| | | left join sys_dept d on u.dept_id = d.dept_id |
| | | left join user_role ur on u.id = ur.user_id |
| | | left join sys_user_role ur on u.id = ur.user_id |
| | | left join sys_role r on r.role_id = ur.role_id |
| | | where u.del_flag = '0' and (r.role_id != #{roleId} or r.role_id IS NULL) |
| | | and u.id not in (select u.id from user u inner join user_role ur on u.id = ur.user_id and ur.role_id = #{roleId}) |
| | | and u.id not in (select u.id from user u inner join sys_user_role ur on u.id = ur.user_id and ur.role_id = #{roleId}) |
| | | <if test="userName != null and userName != ''"> |
| | | AND u.account like concat('%', #{userName}, '%') |
| | | </if> |
| | |
| | | <if test="status != null and status != ''">status,</if> |
| | | <if test="createBy != null and createBy != ''">create_by,</if> |
| | | <if test="remark != null and remark != ''">remark,</if> |
| | | <if test="nameEn != null and nameEn != ''">name_en,</if> |
| | | <if test="signatureUrl != null and signatureUrl != ''">signature_url,</if> |
| | | <if test="company != null and company != ''">company,</if> |
| | | create_time |
| | | )values( |
| | | <if test="userId != null and userId != ''">#{userId},</if> |
| | |
| | | <if test="status != null and status != ''">#{status},</if> |
| | | <if test="createBy != null and createBy != ''">#{createBy},</if> |
| | | <if test="remark != null and remark != ''">#{remark},</if> |
| | | <if test="nameEn != null and nameEn != ''">#{nameEn},</if> |
| | | <if test="signatureUrl != null and signatureUrl != ''">#{signatureUrl},</if> |
| | | <if test="company != null and company != ''">#{company},</if> |
| | | sysdate() |
| | | ) |
| | | </insert> |
| | |
| | | <if test="loginDate != null">login_date = #{loginDate},</if> |
| | | <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> |
| | | <if test="remark != null">remark = #{remark},</if> |
| | | <if test="nameEn != null and nameEn != ''">name_en = #{nameEn},</if> |
| | | <if test="signatureUrl != null and signatureUrl != ''">signature_url = #{signatureUrl},</if> |
| | | <if test="pictureUrl != null and pictureUrl != ''">picture_url = #{pictureUrl},</if> |
| | | <if test="company != null and company != ''">company = #{company},</if> |
| | | update_time = sysdate() |
| | | </set> |
| | | where id = #{userId} |