|
@@ -1,43 +1,72 @@
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<!DOCTYPE mapper
|
|
<!DOCTYPE mapper
|
|
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
|
|
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="com.ruoyi.qdtl.mapper.TlInspectionPlanMapper">
|
|
<mapper namespace="com.ruoyi.qdtl.mapper.TlInspectionPlanMapper">
|
|
-
|
|
|
|
|
|
+
|
|
<resultMap type="TlInspectionPlan" id="TlInspectionPlanResult">
|
|
<resultMap type="TlInspectionPlan" id="TlInspectionPlanResult">
|
|
- <result property="id" column="id" />
|
|
|
|
- <result property="planCode" column="plan_code" />
|
|
|
|
- <result property="planName" column="plan_name" />
|
|
|
|
- <result property="planType" column="plan_type" />
|
|
|
|
- <result property="startDate" column="start_date" />
|
|
|
|
- <result property="endDate" column="end_date" />
|
|
|
|
- <result property="lineId" column="line_id" />
|
|
|
|
- <result property="score" column="score" />
|
|
|
|
- <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="id" column="id"/>
|
|
|
|
+ <result property="planCode" column="plan_code"/>
|
|
|
|
+ <result property="planName" column="plan_name"/>
|
|
|
|
+ <result property="planType" column="plan_type"/>
|
|
|
|
+ <result property="startDate" column="start_date"/>
|
|
|
|
+ <result property="endDate" column="end_date"/>
|
|
|
|
+ <result property="lineId" column="line_id"/>
|
|
|
|
+ <result property="status" column="status"/>
|
|
|
|
+ <result property="score" column="score"/>
|
|
|
|
+ <result property="createBy" column="create_by"/>
|
|
|
|
+ <result property="createTime" column="create_time"/>
|
|
|
|
+ <result property="updateBy" column="update_by"/>
|
|
|
|
+ <result property="updateTime" column="update_time"/>
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectTlInspectionPlanVo">
|
|
<sql id="selectTlInspectionPlanVo">
|
|
- select id, plan_code, plan_name, plan_type, start_date, end_date, line_id, score, create_by, create_time, update_by, update_time from tl_inspection_plan
|
|
|
|
|
|
+ select id,
|
|
|
|
+ plan_code,
|
|
|
|
+ plan_name,
|
|
|
|
+ plan_type,
|
|
|
|
+ start_date,
|
|
|
|
+ end_date,
|
|
|
|
+ line_id,
|
|
|
|
+ score,
|
|
|
|
+ status,
|
|
|
|
+ create_by,
|
|
|
|
+ create_time,
|
|
|
|
+ update_by,
|
|
|
|
+ update_time
|
|
|
|
+ from tl_inspection_plan
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
<select id="selectTlInspectionPlanList" parameterType="TlInspectionPlan" resultMap="TlInspectionPlanResult">
|
|
<select id="selectTlInspectionPlanList" parameterType="TlInspectionPlan" resultMap="TlInspectionPlanResult">
|
|
<include refid="selectTlInspectionPlanVo"/>
|
|
<include refid="selectTlInspectionPlanVo"/>
|
|
- <where>
|
|
|
|
- <if test="planCode != null and planCode != ''"> and plan_code like concat('%', #{planCode}, '%')</if>
|
|
|
|
- <if test="planName != null and planName != ''"> and plan_name like concat('%', #{planName}, '%')</if>
|
|
|
|
- <if test="planType != null and planType != ''"> and plan_type = #{planType}</if>
|
|
|
|
|
|
+ <where>
|
|
|
|
+ <if test="planCode != null and planCode != ''">and plan_code like concat('%', #{planCode}, '%')</if>
|
|
|
|
+ <if test="planName != null and planName != ''">and plan_name like concat('%', #{planName}, '%')</if>
|
|
|
|
+ <if test="planType != null and planType != ''">and plan_type = #{planType}</if>
|
|
|
|
+ and status != '3'
|
|
</where>
|
|
</where>
|
|
order by create_time desc
|
|
order by create_time desc
|
|
</select>
|
|
</select>
|
|
-
|
|
|
|
|
|
+
|
|
<select id="selectTlInspectionPlanById" parameterType="Long" resultMap="TlInspectionPlanResult">
|
|
<select id="selectTlInspectionPlanById" parameterType="Long" resultMap="TlInspectionPlanResult">
|
|
<include refid="selectTlInspectionPlanVo"/>
|
|
<include refid="selectTlInspectionPlanVo"/>
|
|
where id = #{id}
|
|
where id = #{id}
|
|
|
|
+ and status != '3'
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="queryPlanByDate" resultMap="TlInspectionPlanResult">
|
|
|
|
+ <include refid="selectTlInspectionPlanVo"/>
|
|
|
|
+ where status = '1' and start_date <= #{queryDate} and end_date >= #{queryDate}
|
|
</select>
|
|
</select>
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ <select id="queryPlanUser" resultType="com.ruoyi.qdtl.domain.PlanUser">
|
|
|
|
+ select plan_id as planId, t1.user_id as userId, t1.nick_name as nickName, patrolman as card
|
|
|
|
+ from tl_inspection_plan_user t1
|
|
|
|
+ left join sys_user t2 on t1.user_id = t2.user_id
|
|
|
|
+ where t1.plan_id = #{id}
|
|
|
|
+ and t2.patrolman != '';
|
|
|
|
+ </select>
|
|
|
|
+
|
|
<insert id="insertTlInspectionPlan" parameterType="TlInspectionPlan" useGeneratedKeys="true" keyProperty="id">
|
|
<insert id="insertTlInspectionPlan" parameterType="TlInspectionPlan" useGeneratedKeys="true" keyProperty="id">
|
|
insert into tl_inspection_plan
|
|
insert into tl_inspection_plan
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
@@ -52,7 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<if test="createTime != null">create_time,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
<if test="updateBy != null">update_by,</if>
|
|
<if test="updateBy != null">update_by,</if>
|
|
<if test="updateTime != null">update_time,</if>
|
|
<if test="updateTime != null">update_time,</if>
|
|
- </trim>
|
|
|
|
|
|
+ </trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="planCode != null">#{planCode},</if>
|
|
<if test="planCode != null">#{planCode},</if>
|
|
<if test="planName != null">#{planName},</if>
|
|
<if test="planName != null">#{planName},</if>
|
|
@@ -65,7 +94,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<if test="createTime != null">#{createTime},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
- </trim>
|
|
|
|
|
|
+ </trim>
|
|
</insert>
|
|
</insert>
|
|
|
|
|
|
<update id="updateTlInspectionPlan" parameterType="TlInspectionPlan">
|
|
<update id="updateTlInspectionPlan" parameterType="TlInspectionPlan">
|
|
@@ -78,6 +107,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<if test="endDate != null">end_date = #{endDate},</if>
|
|
<if test="endDate != null">end_date = #{endDate},</if>
|
|
<if test="lineId != null">line_id = #{lineId},</if>
|
|
<if test="lineId != null">line_id = #{lineId},</if>
|
|
<if test="score != null">score = #{score},</if>
|
|
<if test="score != null">score = #{score},</if>
|
|
|
|
+ <if test="status != null">status = #{status},</if>
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
@@ -87,11 +117,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
</update>
|
|
</update>
|
|
|
|
|
|
<delete id="deleteTlInspectionPlanById" parameterType="Long">
|
|
<delete id="deleteTlInspectionPlanById" parameterType="Long">
|
|
- delete from tl_inspection_plan where id = #{id}
|
|
|
|
|
|
+ delete
|
|
|
|
+ from tl_inspection_plan
|
|
|
|
+ where id = #{id}
|
|
</delete>
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteTlInspectionPlanByIds" parameterType="String">
|
|
<delete id="deleteTlInspectionPlanByIds" parameterType="String">
|
|
- delete from tl_inspection_plan where id in
|
|
|
|
|
|
+ delete from tl_inspection_plan where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
#{id}
|
|
</foreach>
|
|
</foreach>
|