|
@@ -24,15 +24,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="lng" column="lng" />
|
|
|
<result property="address" column="address" />
|
|
|
<result property="level" column="level" />
|
|
|
+ <result property="dutyDescription" column="duty_description" />
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectDeptVo">
|
|
|
- select d.lat, d.lng, d.address, d.level,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
|
|
|
+ select
|
|
|
+ d.lat,
|
|
|
+ d.lng,
|
|
|
+ d.address, d.level,d.dept_id, d.duty_description, 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
|
|
|
from sys_dept d
|
|
|
</sql>
|
|
|
|
|
|
- <select id="selectDeptList" parameterType="SysDept" resultMap="SysDeptResult">
|
|
|
- <include refid="selectDeptVo"/>
|
|
|
+ <select id="selectDeptList" parameterType="SysDept" resultType="SysDept">
|
|
|
+ select
|
|
|
+ d.lat,
|
|
|
+ d.lng,
|
|
|
+ d.address, d.level,d.dept_id, d.duty_description, 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,
|
|
|
+ (select count(1) from sys_user u where u.dept_id = d.dept_id ) as total_person
|
|
|
+ from sys_dept d
|
|
|
where d.del_flag = '0'
|
|
|
<if test="deptId != null and deptId != 0">
|
|
|
AND dept_id = #{deptId}
|
|
@@ -90,7 +99,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<include refid="selectDeptVo"/>
|
|
|
where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1
|
|
|
</select>
|
|
|
-
|
|
|
+ <select id="selectChildrenDeptIdById" resultType="java.lang.Long">
|
|
|
+ select dept_id from sys_dept where find_in_set(#{deptId}, ancestors)
|
|
|
+ </select>
|
|
|
+
|
|
|
<insert id="insertDept" parameterType="SysDept">
|
|
|
insert into sys_dept(
|
|
|
<if test="deptId != null and deptId != 0">dept_id,</if>
|
|
@@ -107,6 +119,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="lng != null and lng != ''">lng,</if>
|
|
|
<if test="address != null and lat != ''">address,</if>
|
|
|
<if test="level != null and level != ''">level,</if>
|
|
|
+ <if test="dutyDescription != null and dutyDescription != ''">duty_description,</if>
|
|
|
create_time
|
|
|
)values(
|
|
|
<if test="deptId != null and deptId != 0">#{deptId},</if>
|
|
@@ -123,6 +136,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="lng != null and lng != ''">#{lng},</if>
|
|
|
<if test="address != null and lat != ''">#{address},</if>
|
|
|
<if test="level != null and level != ''">#{level},</if>
|
|
|
+ <if test="dutyDescription != null and dutyDescription != ''">#{duty_description},</if>
|
|
|
sysdate()
|
|
|
)
|
|
|
</insert>
|