| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 | <?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.welampiot.dao.PatrolCheckPlanDao">    <select id="getPatrolCheckPlanList" resultType="PatrolCheckPlanDTO">        select p.id,p.sectionId,p.count,p.check_begin_time checkBeginTime,               p.com_count comCount,p.check_end_time checkEndTime        from patrol_check_plan p        left join section s on p.sectionId = s.id        left join global_location gl on s.pid = gl.id        left join global_location gl1 on gl.pid = gl1.id        left join global_location gl2 on gl1.pid = gl2.id        where 1=1        <if test="keyword != null and keyword != ''">            and p.number like '%${keyword}%'        </if>        <if test="sectionList != null and !sectionList.isEmpty()">            and p.sectionId in            <foreach collection="sectionList" item="item" open="(" separator="," close=")">                #{item}            </foreach>        </if>        <if test="areaId != null and areaId != 0">            and gl.id = #{areaId}        </if>        <if test="sectionId != null and sectionId != 0">            and p.sectionId = #{sectionId}        </if>        <if test="cityId != null and cityId != 0">            and gl1.id = #{cityId}        </if>        <if test="provinceId != null and provinceId != 0">            and gl2.id = #{provinceId}        </if>        <if test="page >= 0 and count > 0">            limit #{page},#{count}        </if>    </select>    <select id="getPatrolCheckPlanTotal" resultType="Integer">        select count(p.id)        from patrol_check_plan p        <if test="sectionList != null and !sectionList.isEmpty()">            where p.sectionId in            <foreach collection="sectionList" item="item" open="(" separator="," close=")">                #{item}            </foreach>        </if>    </select>    <select id="getPatrolCheckPlanInfo" resultType="PatrolCheckPlanDTO">        select p.sectionId,p.count,p.check_begin_time checkBeginTime,               p.check_end_time checkEndTime        from patrol_check_plan p        where p.id = #{id}    </select>    <insert id="addPatrolCheckPlanData" keyProperty="id" useGeneratedKeys="true" parameterType="PatrolCheckPlanDTO">        insert into patrol_check_plan(sectionId,count,check_begin_time,check_end_time,create_time,create_id)        values            (#{sectionId},#{count},#{checkBeginTime},#{checkEndTime},#{createTime},#{createId})    </insert>        <update id="updatePatrolCheckPlanData" parameterType="PatrolCheckPlanDTO">        update patrol_check_plan p        set            p.sectionId = #{sectionId},            p.count = #{count},            p.check_begin_time = #{checkBeginTime},            p.check_end_time = #{checkEndTime}        where p.id = #{id}    </update></mapper>
 |