| | |
| | | <result property="updateBy" column="update_by"/> |
| | | <result property="updateTime" column="update_time"/> |
| | | <result property="deptCode" column="dept_code"/> |
| | | <result property="deptType" column="dept_type"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectDeptVo"> |
| | |
| | | d.order_num, |
| | | d.leader, |
| | | d.phone, |
| | | d.dept_type, |
| | | d.email, |
| | | d.status, |
| | | d.del_flag, |
| | |
| | | <if test="deptCode != null and deptCode != ''"> |
| | | AND dept_code = #{deptCode} |
| | | </if> |
| | | <if test="deptType != null and deptType != ''"> |
| | | AND dept_type = #{deptType} |
| | | </if> |
| | | <!-- 数据范围过滤 --> |
| | | ${params.dataScope} |
| | | order by d.parent_id, d.order_num |
| | |
| | | select d.dept_id, |
| | | d.parent_id, |
| | | d.dept_code, |
| | | d.dept_type, |
| | | d.ancestors, |
| | | d.dept_name, |
| | | d.order_num, |
| | |
| | | (select dept_name from sys_dept where dept_id = d.parent_id) parent_name |
| | | from sys_dept d |
| | | where d.dept_id = #{deptId} |
| | | </select> |
| | | |
| | | <select id="selectDeptByCode" parameterType="string" resultMap="SysDeptResult"> |
| | | select d.dept_id, |
| | | d.parent_id, |
| | | d.dept_code, |
| | | d.dept_type, |
| | | d.ancestors, |
| | | d.dept_name, |
| | | d.order_num, |
| | | d.leader, |
| | | d.phone, |
| | | d.email, |
| | | d.status |
| | | from sys_dept d |
| | | where del_flag = 0 |
| | | and d.dept_code = #{deptCode} |
| | | </select> |
| | | |
| | | <select id="checkDeptExistUser" parameterType="Long" resultType="int"> |
| | |
| | | <if test="email != null and email != ''">email,</if> |
| | | <if test="status != null">status,</if> |
| | | <if test="deptCode != null">dept_code,</if> |
| | | <if test="deptType != null">dept_type,</if> |
| | | <if test="createBy != null and createBy != ''">create_by,</if> |
| | | create_time |
| | | )values( |
| | |
| | | <if test="email != null and email != ''">#{email},</if> |
| | | <if test="status != null">#{status},</if> |
| | | <if test="deptCode != null">#{deptCode},</if> |
| | | <if test="deptType != null">#{deptType},</if> |
| | | <if test="createBy != null and createBy != ''">#{createBy},</if> |
| | | sysdate() |
| | | ) |
| | |
| | | <if test="email != null">email = #{email},</if> |
| | | <if test="status != null and status != ''">status = #{status},</if> |
| | | <if test="deptCode != null">dept_code=#{deptCode},</if> |
| | | <if test="deptType != null">dept_type=#{deptType},</if> |
| | | <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> |
| | | update_time = sysdate() |
| | | </set> |