You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

154 lines
9.0 KiB
XML

<?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.aucma.dms.mapper.DmsPlanInspectMapper">
<resultMap type="DmsPlanInspect" id="DmsPlanInspectResult">
<result property="planInspectId" column="plan_inspect_id" />
<result property="planInspectCode" column="plan_inspect_code" />
<result property="planInspectName" column="plan_inspect_name" />
<result property="inspectType" column="inspect_type" />
<result property="inspectRouteId" column="inspect_route_id" />
<result property="deviceAmount" column="device_amount" />
<result property="planTime" column="plan_time" />
<result property="timeLimit" column="time_limit" />
<result property="jobId" column="job_id" />
<result property="cyclePeriod" column="cycle_period" />
<result property="performer" column="performer" />
<result property="isFlag" column="is_flag" />
<result property="remark" column="remark" />
<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="cronExpression" column="cron_expression" />
</resultMap>
<sql id="selectDmsPlanInspectVo">
select plan_inspect_id, plan_inspect_code, plan_inspect_name, inspect_type, inspect_route_id, device_amount, plan_time, cycle_period,time_limit,job_id, performer, is_flag, remark, create_by, create_time, update_by, update_time from dms_plan_inspect
</sql>
<select id="selectDmsPlanInspectList" parameterType="DmsPlanInspect" resultMap="DmsPlanInspectResult">
<include refid="selectDmsPlanInspectVo"/>
<where>
<if test="planInspectCode != null and planInspectCode != ''"> and plan_inspect_code = #{planInspectCode}</if>
<if test="planInspectName != null and planInspectName != ''"> and plan_inspect_name like concat('%', #{planInspectName}, '%')</if>
<if test="inspectType != null and inspectType != ''"> and inspect_type = #{inspectType}</if>
<if test="inspectRouteId != null "> and inspect_route_id = #{inspectRouteId}</if>
<if test="deviceAmount != null "> and device_amount = #{deviceAmount}</if>
<if test="planTime != null "> and plan_time = #{planTime}</if>
<if test="timeLimit != null "> and time_limit = #{timeLimit}</if>
<if test="jobId != null "> and job_id = #{jobId}</if>
<if test="cyclePeriod != null and cyclePeriod != ''"> and cycle_period = #{cyclePeriod}</if>
<if test="performer != null and performer != ''"> and performer = #{performer}</if>
<if test="isFlag != null and isFlag != ''"> and is_flag = #{isFlag}</if>
</where>
order by create_time desc
</select>
<select id="selectDmsPlanInspectByPlanInspectId" parameterType="Long" resultMap="DmsPlanInspectResult">
<include refid="selectDmsPlanInspectVo"/>
where plan_inspect_id = #{planInspectId}
</select>
<insert id="insertDmsPlanInspect" parameterType="DmsPlanInspect">
<selectKey keyProperty="planInspectId" resultType="long" order="BEFORE">
SELECT SEQ_DMS_PLAN_INSPECT.NEXTVAL FROM DUAL
</selectKey>
insert into dms_plan_inspect
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="planInspectId != null">plan_inspect_id,</if>
<if test="planInspectCode != null">plan_inspect_code,</if>
<if test="planInspectName != null">plan_inspect_name,</if>
<if test="inspectType != null">inspect_type,</if>
<if test="inspectRouteId != null">inspect_route_id,</if>
<if test="deviceAmount != null">device_amount,</if>
<if test="planTime != null">plan_time,</if>
<if test="timeLimit != null">time_limit,</if>
<if test="jobId != null">job_id,</if>
<if test="cyclePeriod != null">cycle_period,</if>
<if test="performer != null">performer,</if>
<if test="isFlag != null and isFlag != ''">is_flag,</if>
<if test="remark != null">remark,</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>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="planInspectId != null">#{planInspectId,jdbcType=NUMERIC},</if>
<if test="planInspectCode != null">#{planInspectCode},</if>
<if test="planInspectName != null">#{planInspectName},</if>
<if test="inspectType != null">#{inspectType},</if>
<if test="inspectRouteId != null">#{inspectRouteId,jdbcType=NUMERIC},</if>
<if test="deviceAmount != null">#{deviceAmount,jdbcType=NUMERIC},</if>
<if test="planTime != null">#{planTime},</if>
<if test="timeLimit != null">#{timeLimit,jdbcType=NUMERIC},</if>
<if test="jobId != null">#{jobId,jdbcType=NUMERIC},</if>
<if test="cyclePeriod != null">#{cyclePeriod},</if>
<if test="performer != null">#{performer},</if>
<if test="isFlag != null and isFlag != ''">#{isFlag},</if>
<if test="remark != null">#{remark},</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>
</trim>
</insert>
<update id="updateDmsPlanInspect" parameterType="DmsPlanInspect">
update dms_plan_inspect
<trim prefix="SET" suffixOverrides=",">
<if test="planInspectCode != null">plan_inspect_code = #{planInspectCode},</if>
<if test="planInspectName != null">plan_inspect_name = #{planInspectName},</if>
<if test="inspectType != null">inspect_type = #{inspectType},</if>
<if test="inspectRouteId != null">inspect_route_id = #{inspectRouteId},</if>
<if test="deviceAmount != null">device_amount = #{deviceAmount},</if>
<if test="planTime != null">plan_time = #{planTime},</if>
<if test="timeLimit != null">time_limit = #{timeLimit},</if>
<if test="jobId != null">job_id = #{jobId},</if>
<if test="cyclePeriod != null">cycle_period = #{cyclePeriod},</if>
<if test="performer != null">performer = #{performer},</if>
<if test="isFlag != null and isFlag != ''">is_flag = #{isFlag},</if>
<if test="remark != null">remark = #{remark},</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>
</trim>
where plan_inspect_id = #{planInspectId}
</update>
<delete id="deleteDmsPlanInspectByPlanInspectId" parameterType="Long">
delete from dms_plan_inspect where plan_inspect_id = #{planInspectId}
</delete>
<delete id="deleteDmsPlanInspectByPlanInspectIds" parameterType="String">
delete from dms_plan_inspect where plan_inspect_id in
<foreach item="planInspectId" collection="array" open="(" separator="," close=")">
#{planInspectId}
</foreach>
</delete>
<select id="selectPlanInspectJoinJobByInspectId" parameterType="Long" resultMap="DmsPlanInspectResult">
select a.plan_inspect_id, a.plan_inspect_code, a.plan_inspect_name, a.inspect_type,
a.inspect_route_id, a.device_amount, a.plan_time, a.cycle_period,a.time_limit,a.job_id,
a.performer, a.is_flag, a.remark, a.create_by, a.create_time, a.update_by, a.update_time,b.cron_expression from dms_plan_inspect a
left join sys_job b on a.job_id = b.job_id
where a.plan_inspect_id = #{planInspectId}
</select>
<select id="selectPlanInspectJoinJobByInspectId1" resultType="com.aucma.dms.domain.DmsPlanInspect"
parameterType="java.lang.String">
select a.plan_inspect_id, a.plan_inspect_code, a.plan_inspect_name, a.inspect_type,
a.inspect_route_id, a.device_amount, a.plan_time, a.cycle_period,a.time_limit,a.job_id,
a.performer, a.is_flag, a.remark, a.create_by, a.create_time, a.update_by, a.update_time,b.cron_expression from dms_plan_inspect a
left join sys_job b on a.job_id = b.job_id
where a.plan_inspect_code = #{planInspectId}
</select>
</mapper>