| | |
| | | <result column="user_type" property="userType"/> |
| | | <result column="zj" property="zj"/> |
| | | <result column="mobile" property="mobile"/> |
| | | <result column="expiration_date" property="expirationDate"/> |
| | | </resultMap> |
| | | <resultMap type="com.ycl.entity.user.UmsAdmin" id="CondMapResultMap" extends="BaseResultMap"> |
| | | <collection property="depart" javaType="ArrayList" ofType="com.ycl.entity.depart.UmsDepart"> |
| | |
| | | <result column="depart_update_time" property="updateTime"/> |
| | | <result column="is_deleted" property="isDeleted"/> |
| | | </collection> |
| | | <collection property="roles" javaType="ArrayList" ofType="com.ycl.entity.user.UmsRole" column="id" |
| | | select="selectAdminRoles"> |
| | | <id column="role_id" property="id"/> |
| | | <result column="name" property="name"/> |
| | | <result column="description" property="description"/> |
| | | <result column="admin_count" property="adminCount"/> |
| | | <collection property="roles" javaType="ArrayList" ofType="com.ycl.entity.user.UmsRole"> |
| | | <result column="role_id" property="id"/> |
| | | <result column="role_name" property="name"/> |
| | | <result column="role_description" property="description"/> |
| | | <result column="role_admin_count" property="adminCount"/> |
| | | <result column="role_create_time" property="createTime"/> |
| | | <result column="role_status" property="status"/> |
| | | <result column="sort" property="sort"/> |
| | | <result column="role_sort" property="sort"/> |
| | | </collection> |
| | | </resultMap> |
| | | |
| | |
| | | ud.create_time depat_create_time, |
| | | ud.update_time depat_update_time, |
| | | ud.STATUS depart_status, |
| | | ud.is_deleted |
| | | ud.is_deleted, |
| | | r.id role_id, |
| | | r.`name` role_name |
| | | FROM |
| | | ums_admin ua |
| | | LEFT JOIN ums_depart_manager udm ON ua.id = udm.user_id |
| | | LEFT JOIN ums_depart ud ON udm.depart_id = ud.id |
| | | LEFT JOIN ums_admin_role_relation ar on ar.admin_id = ua.id |
| | | LEFT JOIN ums_role r on ar.role_id = r.id |
| | | <where> |
| | | <if test="umsAdmin.keyword !=null and umsAdmin.keyword !=''"> |
| | | AND (ua.username LIKE concat('%',#{umsAdmin.keyword,jdbcType=VARCHAR},'%') |
| | |
| | | where ua.id = #{id} |
| | | </select> |
| | | <select id="selectToExp" resultType="com.ycl.entity.user.UmsAdmin" resultMap="CondMapResultMap"> |
| | | SELECT ua.*, |
| | | ud.id depart_id, |
| | | ud.depart_name, |
| | | ud.depart_des, |
| | | ud.depart_type, |
| | | ud.parent_id, |
| | | ud.create_time depat_create_time, |
| | | ud.update_time depat_update_time, |
| | | ud.STATUS depart_status, |
| | | ud.is_deleted |
| | | FROM ums_admin ua |
| | | LEFT JOIN ums_depart_manager udm ON ua.id = udm.user_id |
| | | LEFT JOIN ums_depart ud ON udm.depart_id = ud.id |
| | | ORDER BY ua.id DESC |
| | | </select> |
| | | <select id="selectCondTotal" parameterType="com.ycl.entity.user.UmsAdmin" resultType="java.lang.Long"> |
| | | SELECT count(1) total |
| | | FROM |
| | | ums_admin ua |
| | | <where> |
| | | <if test="umsAdmin.keyword !=null and umsAdmin.keyword !=''"> |
| | | AND (ua.username LIKE concat('%',#{umsAdmin.keyword,jdbcType=VARCHAR},'%') |
| | | or ua.nick_name LIKE concat('%',#{umsAdmin.keyword,jdbcType=VARCHAR},'%') |
| | | or ua.mobile LIKE concat('%',#{umsAdmin.keyword,jdbcType=VARCHAR},'%')) |
| | | </if> |
| | | <if test="umsAdmin.userType !=null and umsAdmin.userType >=0 "> |
| | | AND ua.user_type = #{umsAdmin.userType} |
| | | </if> |
| | | <if test="umsAdmin.jobTitle !=null and umsAdmin.keyword !=''"> |
| | | AND ua.job_title = #{umsAdmin.jobTitle} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <select id="selectCondList" parameterType="com.ycl.entity.user.UmsAdmin" resultMap="CondMapResultMap"> |
| | | SELECT |
| | | ua.*, |
| | | ud.id depart_id, |
| | |
| | | ud.create_time depat_create_time, |
| | | ud.update_time depat_update_time, |
| | | ud.STATUS depart_status, |
| | | ud.is_deleted |
| | | ud.is_deleted, |
| | | r.id role_id, |
| | | r.`name` role_name |
| | | FROM |
| | | ums_admin ua |
| | | LEFT JOIN ums_depart_manager udm ON ua.id = udm.user_id |
| | | LEFT JOIN ums_depart ud ON udm.depart_id = ud.id |
| | | (select * from ums_admin ua |
| | | <where> |
| | | <if test="umsAdmin.keyword !=null and umsAdmin.keyword !=''"> |
| | | AND (ua.username LIKE concat('%',#{umsAdmin.keyword,jdbcType=VARCHAR},'%') |
| | | or ua.nick_name LIKE concat('%',#{umsAdmin.keyword,jdbcType=VARCHAR},'%') |
| | | or ua.mobile LIKE concat('%',#{umsAdmin.keyword,jdbcType=VARCHAR},'%')) |
| | | </if> |
| | | <if test="umsAdmin.userType !=null and umsAdmin.userType >=0 "> |
| | | AND ua.user_type = #{umsAdmin.userType} |
| | | </if> |
| | | <if test="umsAdmin.jobTitle !=null and umsAdmin.keyword !=''"> |
| | | AND ua.job_title = #{umsAdmin.jobTitle} |
| | | </if> |
| | | </where> |
| | | ORDER BY |
| | | ua.id DESC |
| | | LIMIT #{offset}, #{size} ) as |
| | | ua |
| | | LEFT JOIN ums_depart_manager udm ON ua.id = udm.user_id |
| | | LEFT JOIN ums_depart ud ON udm.depart_id = ud.id |
| | | LEFT JOIN ums_admin_role_relation ar on ar.admin_id = ua.id |
| | | LEFT JOIN ums_role r on ar.role_id = r.id |
| | | |
| | | </select> |
| | | </mapper> |