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.
125 lines
7.3 KiB
XML
125 lines
7.3 KiB
XML
1 year ago
|
<?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="cyclePeriod" column="cycle_period" />
|
||
|
<result property="lubeStatus" column="lube_status" />
|
||
|
<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, cycle_period, lube_status, 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">
|
||
|
select a.plan_lube_id, a.plan_lube_code, a.device_id, a.lube_level, a.lube_group, a.lube_supervisor, a.lube_time, a.cycle_period, a.lube_status, a.create_method, a.is_flag, a.remark, a.create_by, a.create_time, a.update_by, a.update_time
|
||
|
from dms_plan_lube a
|
||
|
left join dms_base_device_ledger b on a.device_id = b.device_id
|
||
|
<where>
|
||
|
<if test="planLubeCode != null and planLubeCode != ''"> and a.plan_lube_code = #{planLubeCode}</if>
|
||
|
<if test="deviceId != null "> and a.device_id = #{deviceId}</if>
|
||
|
<if test="deviceName != null "> and b.device_name like concat('%', #{deviceName},'%')</if>
|
||
|
<if test="lubeLevel != null and lubeLevel != ''"> and a.lube_level = #{lubeLevel}</if>
|
||
|
<if test="lubeGroup != null and lubeGroup != ''"> and a.lube_group = #{lubeGroup}</if>
|
||
|
<if test="lubeSupervisor != null and lubeSupervisor != ''"> and a.lube_supervisor = #{lubeSupervisor}</if>
|
||
|
<if test="params.beginTime != null and params.endTime != null">and a.lube_time between #{params.beginTime} and #{params.endTime} </if>
|
||
|
<if test="cyclePeriod != null and cyclePeriod != ''"> and a.cycle_period = #{cyclePeriod}</if>
|
||
|
<if test="lubeStatus != null and lubeStatus != ''"> and a.lube_status = #{lubeStatus}</if>
|
||
|
<if test="createMethod != null and createMethod != ''"> and a.create_method = #{createMethod}</if>
|
||
|
<if test="isFlag != null and isFlag != ''"> and a.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="cyclePeriod != null">cycle_period,</if>
|
||
|
<if test="lubeStatus != null">lube_status,</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="cyclePeriod != null">#{cyclePeriod},</if>
|
||
|
<if test="lubeStatus != null">#{lubeStatus},</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="cyclePeriod != null">cycle_period = #{cyclePeriod},</if>
|
||
|
<if test="lubeStatus != null">lube_status = #{lubeStatus},</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>
|