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.

127 lines
7.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.hw.dms.mapper.DmsPlanLubeMapper">
<resultMap type="DmsPlanLube" id="DmsPlanLubeResult">
<result property="planLubeId" column="plan_lube_id" />
<result property="planLubeCode" column="plan_lube_code" />
<result property="deviceId" column="device_id" />
<result property="lubeLevel" column="lube_level" />
<result property="lubeGroup" column="lube_group" />
<result property="lubeSupervisor" column="lube_supervisor" />
<result property="lubeTime" column="lube_time" />
<result property="timeLimit" column="time_limit" />
<result property="jobId" column="job_id" />
<result property="cyclePeriod" column="cycle_period" />
<result property="createMethod" column="create_method" />
<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" />
</resultMap>
<sql id="selectDmsPlanLubeVo">
select plan_lube_id, plan_lube_code, device_id, lube_level, lube_group, lube_supervisor, lube_time, time_limit, job_id, cycle_period, create_method, is_flag, remark, create_by, create_time, update_by, update_time from dms_plan_lube
</sql>
<select id="selectDmsPlanLubeList" parameterType="DmsPlanLube" resultMap="DmsPlanLubeResult">
<include refid="selectDmsPlanLubeVo"/>
<where>
<if test="planLubeCode != null and planLubeCode != ''"> and plan_lube_code = #{planLubeCode}</if>
<if test="deviceId != null "> and device_id = #{deviceId}</if>
<if test="lubeLevel != null and lubeLevel != ''"> and lube_level = #{lubeLevel}</if>
<if test="lubeGroup != null and lubeGroup != ''"> and lube_group = #{lubeGroup}</if>
<if test="lubeSupervisor != null and lubeSupervisor != ''"> and lube_supervisor = #{lubeSupervisor}</if>
<if test="lubeTime != null "> and lube_time = #{lubeTime}</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="createMethod != null and createMethod != ''"> and create_method = #{createMethod}</if>
<if test="isFlag != null and isFlag != ''"> and is_flag = #{isFlag}</if>
</where>
</select>
<select id="selectDmsPlanLubeByPlanLubeId" parameterType="Long" resultMap="DmsPlanLubeResult">
<include refid="selectDmsPlanLubeVo"/>
where plan_lube_id = #{planLubeId}
</select>
<insert id="insertDmsPlanLube" parameterType="DmsPlanLube" useGeneratedKeys="true" keyProperty="planLubeId">
insert into dms_plan_lube
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="planLubeCode != null">plan_lube_code,</if>
<if test="deviceId != null">device_id,</if>
<if test="lubeLevel != null">lube_level,</if>
<if test="lubeGroup != null">lube_group,</if>
<if test="lubeSupervisor != null">lube_supervisor,</if>
<if test="lubeTime != null">lube_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="createMethod != null">create_method,</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="planLubeCode != null">#{planLubeCode},</if>
<if test="deviceId != null">#{deviceId},</if>
<if test="lubeLevel != null">#{lubeLevel},</if>
<if test="lubeGroup != null">#{lubeGroup},</if>
<if test="lubeSupervisor != null">#{lubeSupervisor},</if>
<if test="lubeTime != null">#{lubeTime},</if>
<if test="timeLimit != null">#{timeLimit},</if>
<if test="jobId != null">#{jobId},</if>
<if test="cyclePeriod != null">#{cyclePeriod},</if>
<if test="createMethod != null">#{createMethod},</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="updateDmsPlanLube" parameterType="DmsPlanLube">
update dms_plan_lube
<trim prefix="SET" suffixOverrides=",">
<if test="planLubeCode != null">plan_lube_code = #{planLubeCode},</if>
<if test="deviceId != null">device_id = #{deviceId},</if>
<if test="lubeLevel != null">lube_level = #{lubeLevel},</if>
<if test="lubeGroup != null">lube_group = #{lubeGroup},</if>
<if test="lubeSupervisor != null">lube_supervisor = #{lubeSupervisor},</if>
<if test="lubeTime != null">lube_time = #{lubeTime},</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="createMethod != null">create_method = #{createMethod},</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_lube_id = #{planLubeId}
</update>
<delete id="deleteDmsPlanLubeByPlanLubeId" parameterType="Long">
delete from dms_plan_lube where plan_lube_id = #{planLubeId}
</delete>
<delete id="deleteDmsPlanLubeByPlanLubeIds" parameterType="String">
delete from dms_plan_lube where plan_lube_id in
<foreach item="planLubeId" collection="array" open="(" separator="," close=")">
#{planLubeId}
</foreach>
</delete>
</mapper>