| | |
| | | </resultMap> |
| | | <resultMap type="com.gkhy.exam.system.domain.vo.DeptVo" id="DeptVoResult" extends="SysDeptResult"> |
| | | <collection property="caluseVO1List" ofType="com.gkhy.exam.system.domain.vo.CaluseVO1"> |
| | | <id property="clauseNum" column="clause_num" /> |
| | | <result property="clauseNum" column="clause_num" /> |
| | | <result property="content" column="content" /> |
| | | <result property="clauseId" column="clause_id" /> |
| | | <result property="id" column="data_id" /> |
| | | </collection> |
| | | </resultMap> |
| | | |
| | |
| | | |
| | | <select id="selectDeptList" parameterType="com.gkhy.exam.common.domain.entity.SysDept" resultMap="DeptVoResult"> |
| | | select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader_user_id, d.company_id, d.status, d.del_flag, d.create_by, d.create_time,d.person_num,d.internal_auditors, |
| | | d.responsibilities,u.name as leader_name,d2.dept_name as parent_name, dr.content ,dr.clause_num |
| | | d.responsibilities,u.name as leader_name,d2.dept_name as parent_name, dr.content ,dr.clause_num,dr.id as data_id,dr.clause_id |
| | | from sys_dept d |
| | | left join sys_user u on d.leader_user_id = u.user_id |
| | | left join sys_user u on d.leader_user_id = u.id |
| | | left join sys_dept d2 on d.parent_id = d2.dept_id |
| | | left join sys_dept_responsibility dr on d.dept_id = dr.dept_id and dr.del_flag = '0' and data_type = 2 |
| | | where d.del_flag = '0' |
| | | <if test="companyId != null and companyId != 0"> |
| | | AND company_id = #{companyId} |
| | | AND d.company_id = #{companyId} |
| | | </if> |
| | | <if test="deptId != null and deptId != 0"> |
| | | AND dept_id = #{deptId} |
| | | AND d.dept_id = #{deptId} |
| | | </if> |
| | | <if test="parentId != null and parentId != 0"> |
| | | AND parent_id = #{parentId} |
| | | AND d.parent_id = #{parentId} |
| | | </if> |
| | | <if test="deptName != null and deptName != ''"> |
| | | AND dept_name like concat('%', #{deptName}, '%') |
| | | AND d.dept_name like concat('%', #{deptName}, '%') |
| | | </if> |
| | | <if test="status != null and status != ''"> |
| | | AND status = #{status} |
| | | AND d.status = #{status} |
| | | </if> |
| | | order by d.parent_id, d.order_num |
| | | </select> |
| | |
| | | and del_flag = '0' limit 1 |
| | | </select> |
| | | |
| | | <insert id="insertDept" parameterType="com.gkhy.exam.common.domain.entity.SysDept"> |
| | | <insert id="insertDept" parameterType="com.gkhy.exam.common.domain.entity.SysDept" useGeneratedKeys="true" keyProperty="deptId"> |
| | | insert into sys_dept( |
| | | <if test="deptId != null and deptId != 0">dept_id,</if> |
| | | <if test="parentId != null and parentId != 0">parent_id,</if> |
| | |
| | | </update> |
| | | |
| | | <delete id="deleteDeptById" parameterType="Long"> |
| | | update sys_dept set del_flag = '2' where dept_id = #{deptId} |
| | | update sys_dept set del_flag = '1' where dept_id = #{deptId} |
| | | </delete> |
| | | |
| | | </mapper> |