| 对比新文件 |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.doumee.dao.system.SystemDepartmentMapper"> |
| | | |
| | | <!-- 鏌ヨ閮ㄩ棬鍒楄〃 --> |
| | | <resultMap id="SystemDepartmentListVO" type="com.doumee.dao.system.vo.SystemDepartmentListVO" autoMapping="true"> |
| | | <id column="ID" property="id"/> |
| | | <association property="createUserInfo" javaType="com.doumee.dao.system.model.SystemUser"> |
| | | <result column="CREATE_USER_ID" property="id"/> |
| | | <result column="CREATE_USER_NAME" property="username"/> |
| | | </association> |
| | | <association property="updateUserInfo" javaType="com.doumee.dao.system.model.SystemUser"> |
| | | <result column="UPDATE_USER_ID" property="id"/> |
| | | <result column="UPDATE_USER_NAME" property="username"/> |
| | | </association> |
| | | </resultMap> |
| | | <select id="selectManageList" parameterType="com.doumee.dao.system.dto.QuerySystemDepartmentDTO" resultMap="SystemDepartmentListVO"> |
| | | SELECT |
| | | dept.`ID`, dept.`PARENT_ID`, dept.`CODE`, dept.`NAME`, dept.`PHONE`, dept.`EMAIL`, dept.`CREATE_TIME`, dept.`UPDATE_TIME`, dept.`CREATE_USER`, dept.`UPDATE_USER`, dept.`DELETED`, |
| | | create_user.ID CREATE_USER_ID, create_user.`USERNAME` CREATE_USER_NAME, |
| | | update_user.ID UPDETE_USER_ID, update_user.`USERNAME` UPDATE_USER_NAME, |
| | | COUNT(usr.ID) USER_COUNT |
| | | FROM SYSTEM_DEPARTMENT dept |
| | | LEFT JOIN `SYSTEM_DEPARTMENT_USER` sdu ON sdu.DEPARTMENT_ID = dept.ID AND sdu.DELETED = 0 |
| | | LEFT JOIN `SYSTEM_USER` usr ON usr.ID = sdu.USER_ID AND usr.DELETED = 0 |
| | | LEFT JOIN `SYSTEM_USER` create_user ON create_user.ID = dept.CREATE_USER |
| | | LEFT JOIN `SYSTEM_USER` update_user ON update_user.ID = dept.UPDATE_USER |
| | | <where> |
| | | dept.DELETED = 0 |
| | | <if test="id != null"> |
| | | AND dept.ID = #{id} |
| | | </if> |
| | | <if test="ids != null"> |
| | | AND dept.ID IN |
| | | <foreach collection="ids" item="id" separator="," open="(" close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | GROUP BY dept.`ID` |
| | | </select> |
| | | |
| | | </mapper> |