|
|
@@ -21,40 +21,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="updateBy" column="update_by" />
|
|
|
<result property="updateTime" column="update_time" />
|
|
|
<result property="companyId" column="company_id" />
|
|
|
- <result property="companyName" column="company_name" />
|
|
|
+ <result property="companyName" column="companyName" />
|
|
|
<result property="maxDuration" column="max_duration" />
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectDeptVo">
|
|
|
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status,
|
|
|
- d.del_flag, d.create_by, d.create_time,d.company_id,d.company_name,d.max_duration
|
|
|
- from sys_dept d
|
|
|
+ d.del_flag, d.create_by, d.create_time,d.company_id,d.company_name,d.max_duration,sd.dept_name companyName
|
|
|
+ from sys_dept d left join sys_dept sd on d.company_id = sd.dept_id
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectDeptList" parameterType="SysDept" resultMap="SysDeptResult">
|
|
|
<include refid="selectDeptVo"/>
|
|
|
where d.del_flag = '0'
|
|
|
<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>
|
|
|
<if test="companyName != null and companyName != ''">
|
|
|
- AND company_name like concat('%', #{companyName}, '%')
|
|
|
+ AND d.company_name like concat('%', #{companyName}, '%')
|
|
|
</if>
|
|
|
|
|
|
<if test="startTime != null and endTime !=null">
|
|
|
- AND create_time bentween #{startTime} and #{endTime}
|
|
|
+ AND d.create_time bentween #{startTime} and #{endTime}
|
|
|
</if>
|
|
|
<if test="ancestors !=null">
|
|
|
- and (dept_id= #{ancestors} or find_in_set(#{ancestors},ancestors))
|
|
|
+ and (d.dept_id= #{ancestors} or find_in_set(#{ancestors},d.ancestors))
|
|
|
</if>
|
|
|
<!-- 数据范围过滤 -->
|
|
|
${params.dataScope}
|
|
|
@@ -102,7 +102,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</select>
|
|
|
<select id="getCompany" resultMap="SysDeptResult">
|
|
|
<include refid="selectDeptVo"/>
|
|
|
- where parent_id = 100
|
|
|
+ where d.parent_id = 100
|
|
|
</select>
|
|
|
|
|
|
<insert id="insertDept" parameterType="SysDept">
|