|
@@ -12,31 +12,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="stationName" column="station_name" />
|
|
|
<result property="qrCode" column="qr_code" />
|
|
|
<result property="personnelPhone" column="personnel_phone" />
|
|
|
+ <result property="delFlag" column="del_flag" />
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectStationPersonnelVo">
|
|
|
- select personnel_id, personnel_name, gun_no, station_id, d.dept_name as station_name, qr_code, personnel_phone
|
|
|
+ select personnel_id, personnel_name, gun_no, station_id, d.dept_name as station_name, qr_code, personnel_phone,p.del_flag
|
|
|
from station_personnel p join sys_dept d on p.station_id = d.dept_id
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectStationPersonnelList" parameterType="StationPersonnel" resultMap="StationPersonnelResult">
|
|
|
<include refid="selectStationPersonnelVo"/>
|
|
|
- <where>
|
|
|
- <if test="personnelName != null and personnelName != ''"> and personnel_name like concat('%', #{personnelName}, '%')</if>
|
|
|
- <if test="gunNo != null and gunNo != ''"> and gun_no = #{gunNo}</if>
|
|
|
- <if test="stationId != null "> and station_id = #{stationId}</if>
|
|
|
+ where p.del_flag ='0'
|
|
|
+ <if test="personnelName != null and personnelName != ''"> and p.personnel_name like concat('%', #{personnelName}, '%')</if>
|
|
|
+ <if test="gunNo != null and gunNo != ''"> and p.gun_no = #{gunNo}</if>
|
|
|
+ <if test="stationId != null "> and p.station_id = #{stationId}</if>
|
|
|
<if test="stationName != null and stationName != ''"> and d.dept_name like concat('%', #{stationName}, '%')</if>
|
|
|
<if test="qrCode != null and qrCode != ''"> and qr_code = #{qrCode}</if>
|
|
|
<if test="personnelPhone != null and personnelPhone != ''"> and personnel_phone = #{personnelPhone}</if>
|
|
|
<if test="stationIdList != null ">
|
|
|
- and station_id in
|
|
|
+ and p.station_id in
|
|
|
<foreach item="item" index="index" collection="stationIdList"
|
|
|
open="(" separator="," close=")">
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
- </where>
|
|
|
- order by personnel_id desc
|
|
|
+ order by personnel_id desc
|
|
|
</select>
|
|
|
|
|
|
<select id="selectStationPersonnelById" parameterType="Long" resultMap="StationPersonnelResult">
|
|
@@ -53,6 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="stationId != null">station_id,</if>
|
|
|
<if test="qrCode != null">qr_code,</if>
|
|
|
<if test="personnelPhone != null">personnel_phone,</if>
|
|
|
+ <if test="delFlag != null">del_flag,</if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="personnelId != null">#{personnelId},</if>
|
|
@@ -61,6 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="stationId != null">#{stationId},</if>
|
|
|
<if test="qrCode != null">#{qrCode},</if>
|
|
|
<if test="personnelPhone != null">#{personnelPhone},</if>
|
|
|
+ <if test="delFlag != null">#{delFlag},</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
|
|
@@ -72,8 +74,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="stationId != null">station_id = #{stationId},</if>
|
|
|
<if test="qrCode != null">qr_code = #{qrCode},</if>
|
|
|
<if test="personnelPhone != null">personnel_phone = #{personnelPhone},</if>
|
|
|
+ <if test="delFlag != null">del_flag = #{delFlag},</if>
|
|
|
</trim>
|
|
|
- where personnel_id = #{personnelId}
|
|
|
+ where personnel_id = #{personnelId}
|
|
|
</update>
|
|
|
|
|
|
<delete id="deleteStationPersonnelById" parameterType="Long">
|
|
@@ -81,8 +84,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteStationPersonnelByIds" parameterType="String">
|
|
|
- delete from station_personnel where personnel_id in
|
|
|
- <foreach item="personnelId" collection="array" open="(" separator="," close=")">
|
|
|
+ update station_personnel set del_flag = '1' where personnel_id in
|
|
|
+ <foreach collection="array" item="personnelId" open="(" separator="," close=")">
|
|
|
#{personnelId}
|
|
|
</foreach>
|
|
|
</delete>
|