安保力量人

This commit is contained in:
renhao 2025-03-07 19:45:22 +08:00
parent 8d98376838
commit 61130d67c7
1 changed files with 136 additions and 0 deletions

View File

@ -0,0 +1,136 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dkl.large.mapper.DklSecurityPersonnelMapper">
<resultMap type="DklSecurityPersonnel" id="DklSecurityPersonnelResult">
<result property="id" column="id" />
<result property="name" column="name" />
<result property="code" column="code" />
<result property="phone" column="phone" />
<result property="entryTime" column="entry_time" />
<result property="post" column="post" />
<result property="certificate" column="certificate" />
<result property="certificateCode" column="certificate_code" />
<result property="remark" column="remark" />
<result property="monitoringPointsId" column="monitoring_points_id" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
<result property="deptId" column="dept_id" />
<result property="sigenCode" column="sigen_code" />
</resultMap>
<sql id="selectDklSecurityPersonnelVo">
select dsp.id, dsp.name,dsp.sigen_code, dsp.code, dsp.phone, dsp.entry_time, dsp.post, dsp.certificate, dsp.certificate_code, dsp.remark,
dsp.monitoring_points_id, dsp.create_by, dsp.create_time, dsp.update_by, dsp.update_time, dsp.del_flag, dsp.dept_id,
dmp.lng, dmp.lat, dmp.point_name AS pointName,dmp.point_address
from dkl_security_personnel dsp
left join sys_dept d on dsp.dept_id = d.dept_id
Left Join dkl_monitoring_points dmp on dmp.id = dsp.monitoring_points_id
</sql>
<select id="selectDklSecurityPersonnelList" parameterType="DklSecurityPersonnel" resultMap="DklSecurityPersonnelResult">
<include refid="selectDklSecurityPersonnelVo"/>
<where>
<if test="name != null and name != ''"> and dsp.name like concat('%', #{name}, '%')</if>
<if test="code != null and code != ''"> and dsp.code = #{code}</if>
<if test="phone != null and phone != ''"> and dsp.phone = #{phone}</if>
<if test="entryTime != null "> and dsp.entry_time = #{entryTime}</if>
<if test="post != null and post != ''"> and dsp.post = #{post}</if>
<if test="certificate != null and certificate != ''"> and dsp.certificate = #{certificate}</if>
<if test="certificateCode != null and certificateCode != ''"> and dsp.certificate_code = #{certificateCode}</if>
<if test="monitoringPointsId != null "> and dsp.monitoring_points_id = #{monitoringPointsId}</if>
<if test="delFlag != null and delFlag != ''"> and dsp.del_flag = #{delFlag}</if>
<if test="startTime != null and endTime != null ">
AND dsp.create_time BETWEEN #{startTime} and #{endTime}
</if>
</where>
${params.dataScope}
order by dsp.create_time desc
</select>
<select id="selectDklSecurityPersonnelById" parameterType="Long" resultMap="DklSecurityPersonnelResult">
<include refid="selectDklSecurityPersonnelVo"/>
where dsp.id = #{id}
</select>
<insert id="insertDklSecurityPersonnel" parameterType="DklSecurityPersonnel">
insert into dkl_security_personnel
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="name != null">name,</if>
<if test="code != null">code,</if>
<if test="phone != null">phone,</if>
<if test="entryTime != null">entry_time,</if>
<if test="post != null">post,</if>
<if test="certificate != null">certificate,</if>
<if test="certificateCode != null">certificate_code,</if>
<if test="remark != null">remark,</if>
<if test="monitoringPointsId != null">monitoring_points_id,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="delFlag != null">del_flag,</if>
<if test="deptId != null">dept_id,</if>
<if test="sigenCode != null">sigen_code,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="name != null">#{name},</if>
<if test="code != null">#{code},</if>
<if test="phone != null">#{phone},</if>
<if test="entryTime != null">#{entryTime},</if>
<if test="post != null">#{post},</if>
<if test="certificate != null">#{certificate},</if>
<if test="certificateCode != null">#{certificateCode},</if>
<if test="remark != null">#{remark},</if>
<if test="monitoringPointsId != null">#{monitoringPointsId},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="deptId != null">#{deptId},</if>
<if test="sigenCode != null">#{sigenCode},</if>
</trim>
</insert>
<update id="updateDklSecurityPersonnel" parameterType="DklSecurityPersonnel">
update dkl_security_personnel
<trim prefix="SET" suffixOverrides=",">
<if test="name != null">name = #{name},</if>
<if test="code != null">code = #{code},</if>
<if test="phone != null">phone = #{phone},</if>
<if test="entryTime != null">entry_time = #{entryTime},</if>
<if test="post != null">post = #{post},</if>
<if test="certificate != null">certificate = #{certificate},</if>
<if test="certificateCode != null">certificate_code = #{certificateCode},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="monitoringPointsId != null">monitoring_points_id = #{monitoringPointsId},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="deptId != null">dept_id = #{deptId},</if>
<if test="sigenCode != null">sigen_code = #{sigenCode},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteDklSecurityPersonnelById" parameterType="Long">
delete from dkl_security_personnel where id = #{id}
</delete>
<delete id="deleteDklSecurityPersonnelByIds" parameterType="String">
delete from dkl_security_personnel where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>