From fc1e38abb2c5c56ac119e2af346c6f3c5f4e5fd5 Mon Sep 17 00:00:00 2001 From: Administrator <1144154118@qq.com> Date: 星期五, 25 八月 2023 17:14:51 +0800 Subject: [PATCH] 筛选井 --- ard-work/src/main/resources/mapper/dispatch/ArdDispatchPoliceMapper.xml | 63 +++++++++++++++++-------------- 1 files changed, 35 insertions(+), 28 deletions(-) diff --git a/ard-work/src/main/resources/mapper/dispatch/ArdDispatchPoliceMapper.xml b/ard-work/src/main/resources/mapper/dispatch/ArdDispatchPoliceMapper.xml index 7056376..90d8a53 100644 --- a/ard-work/src/main/resources/mapper/dispatch/ArdDispatchPoliceMapper.xml +++ b/ard-work/src/main/resources/mapper/dispatch/ArdDispatchPoliceMapper.xml @@ -7,6 +7,7 @@ <resultMap type="ArdDispatchPolice" id="ArdDispatchPoliceResult"> <result property="id" column="id"/> <result property="name" column="name"/> + <result property="text" column="text"/> <result property="longitude" column="longitude"/> <result property="latitude" column="latitude"/> <result property="deptId" column="dept_id"/> @@ -15,38 +16,39 @@ <result property="createTime" column="create_time"/> <result property="updateBy" column="update_by"/> <result property="updateTime" column="update_time"/> - <!-- 瀛愭煡璇紝鍏宠仈 ard_dispatch_police_user 琛� --> - <collection property="ardDispatchPoliceUserList" ofType="java.lang.String" select="getUserIdsByMainTableId" - column="id"/> - </resultMap> - <select id="getUserIdsByMainTableId" resultType="java.lang.String"> - SELECT user_id - FROM ard_dispatch_police_user - WHERE dispatch_id = #{id} - </select> - <resultMap id="ArdDispatchPoliceArdDispatchPoliceUserResult" type="ArdDispatchPolice" - extends="ArdDispatchPoliceResult"> - <collection property="ardDispatchPoliceUserList" notNullColumn="sub_dispatch_id" javaType="java.util.List" - resultMap="ArdDispatchPoliceUserResult"/> + <collection property="sysUserList" javaType="java.util.List" resultMap="SysUserListResult"/> </resultMap> - <resultMap type="ArdDispatchPoliceUser" id="ArdDispatchPoliceUserResult"> - <result property="dispatchId" column="sub_dispatch_id"/> + <resultMap id="ArdDispatchPoliceArdDispatchPoliceUserResult" type="ArdDispatchPolice" + extends="ArdDispatchPoliceResult"> + <collection property="sysUserList" notNullColumn="sub_dispatch_id" javaType="java.util.List" + resultMap="SysUserListResult"/> + </resultMap> + + <resultMap type="SysUser" id="SysUserListResult"> <result property="userId" column="sub_user_id"/> + <result property="nickName" column="sub_nick_name"/> + <result property="deptId" column="sub_dept_id"/> </resultMap> <sql id="selectArdDispatchPoliceVo"> - SELECT ID, - NAME, - longitude, - latitude, - dept_id, - user_id, - create_by, - create_time, - update_by, - update_time - FROM ard_dispatch_police + SELECT adp.ID, + adp.NAME, + adp.text, + adp.longitude, + adp.latitude, + adp.dept_id, + adp.user_id, + adp.create_by, + adp.create_time, + adp.update_by, + adp.update_time, + u.user_id as sub_user_id, + u.nick_name as sub_nick_name, + u.dept_id as sub_dept_id + FROM ard_dispatch_police adp + left join ard_dispatch_police_user b on b.dispatch_id = adp.id + left join sys_user u on b.user_id = u.user_id </sql> <select id="selectArdDispatchPoliceList" parameterType="ArdDispatchPolice" resultMap="ArdDispatchPoliceResult"> @@ -64,6 +66,7 @@ resultMap="ArdDispatchPoliceArdDispatchPoliceUserResult"> select a.id, a.name, + a.text, a.longitude, a.latitude, a.dept_id, @@ -72,8 +75,9 @@ a.create_time, a.update_by, a.update_time, - b.dispatch_id as sub_dispatch_id, - b.user_id as sub_user_id + b.user_id as sub_user_id, + b.nick_name as sub_nick_name, + b.dept_id as sub_dept_id from ard_dispatch_police a left join ard_dispatch_police_user b on b.dispatch_id = a.id where a.id = #{id} @@ -84,6 +88,7 @@ <trim prefix="(" suffix=")" suffixOverrides=","> <if test="id != null">id,</if> <if test="name != null">name,</if> + <if test="text != null">text,</if> <if test="longitude != null">longitude,</if> <if test="latitude != null">latitude,</if> <if test="deptId != null">dept_id,</if> @@ -96,6 +101,7 @@ <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="id != null">#{id},</if> <if test="name != null">#{name},</if> + <if test="text != null">#{text},</if> <if test="longitude != null">#{longitude},</if> <if test="latitude != null">#{latitude},</if> <if test="deptId != null">#{deptId},</if> @@ -111,6 +117,7 @@ update ard_dispatch_police <trim prefix="SET" suffixOverrides=","> <if test="name != null">name = #{name},</if> + <if test="text != null">text = #{text},</if> <if test="longitude != null">longitude = #{longitude},</if> <if test="latitude != null">latitude = #{latitude},</if> <if test="deptId != null">dept_id = #{deptId},</if> -- Gitblit v1.9.3