<?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.jcdm.main.em.equipmentStatus.mapper.EmEquipmentStatusMapper">
|
|
<resultMap type="EmEquipmentStatus" id="EmEquipmentStatusResult">
|
<result property="id" column="id" />
|
<result property="equipmentNo" column="equipment_no" />
|
<result property="equipmentName" column="equipment_name" />
|
<result property="workshopCode" column="workshop_code" />
|
<result property="productionLineCode" column="production_line_code" />
|
<result property="processesCode" column="processes_code" />
|
<result property="eqStatus" column="eq_status" />
|
<result property="spareField1" column="spare_field_1" />
|
<result property="spareField2" column="spare_field_2" />
|
<result property="remarks" column="remarks" />
|
<result property="updateTime" column="update_time" />
|
</resultMap>
|
|
<sql id="selectEmEquipmentStatusVo">
|
select id, equipment_no, equipment_name, workshop_code, production_line_code, processes_code, eq_status, spare_field_1, spare_field_2, remarks, update_time from em_equipment_status
|
</sql>
|
|
<select id="selectEmEquipmentStatusList" parameterType="EmEquipmentStatus" resultMap="EmEquipmentStatusResult">
|
<include refid="selectEmEquipmentStatusVo"/>
|
<where>
|
<if test="equipmentNo != null and equipmentNo != ''"> and equipment_no like concat('%', #{equipmentNo}, '%')</if>
|
<if test="equipmentName != null and equipmentName != ''"> and equipment_name like concat('%', #{equipmentName}, '%')</if>
|
<if test="workshopCode != null and workshopCode != ''"> and workshop_code like concat('%', #{workshopCode}, '%')</if>
|
<if test="productionLineCode != null and productionLineCode != ''"> and production_line_code like concat('%', #{productionLineCode}, '%')</if>
|
<if test="processesCode != null and processesCode != ''"> and processes_code like concat('%', #{processesCode}, '%')</if>
|
<if test="eqStatus != null and eqStatus != ''"> and eq_status like concat('%', #{eqStatus}, '%')</if>
|
</where>
|
</select>
|
|
<select id="selectEmEquipmentStatusById" parameterType="Long" resultMap="EmEquipmentStatusResult">
|
<include refid="selectEmEquipmentStatusVo"/>
|
where id = #{id}
|
</select>
|
|
<insert id="insertEmEquipmentStatus" parameterType="EmEquipmentStatus">
|
insert into em_equipment_status
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">id,</if>
|
<if test="equipmentNo != null">equipment_no,</if>
|
<if test="equipmentName != null">equipment_name,</if>
|
<if test="workshopCode != null">workshop_code,</if>
|
<if test="productionLineCode != null">production_line_code,</if>
|
<if test="processesCode != null">processes_code,</if>
|
<if test="eqStatus != null">eq_status,</if>
|
<if test="spareField1 != null">spare_field_1,</if>
|
<if test="spareField2 != null">spare_field_2,</if>
|
<if test="remarks != null">remarks,</if>
|
<if test="updateTime != null">update_time,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="id != null">#{id},</if>
|
<if test="equipmentNo != null">#{equipmentNo},</if>
|
<if test="equipmentName != null">#{equipmentName},</if>
|
<if test="workshopCode != null">#{workshopCode},</if>
|
<if test="productionLineCode != null">#{productionLineCode},</if>
|
<if test="processesCode != null">#{processesCode},</if>
|
<if test="eqStatus != null">#{eqStatus},</if>
|
<if test="spareField1 != null">#{spareField1},</if>
|
<if test="spareField2 != null">#{spareField2},</if>
|
<if test="remarks != null">#{remarks},</if>
|
<if test="updateTime != null">#{updateTime},</if>
|
</trim>
|
</insert>
|
|
<update id="updateEmEquipmentStatus" parameterType="EmEquipmentStatus">
|
update em_equipment_status
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="equipmentNo != null">equipment_no = #{equipmentNo},</if>
|
<if test="equipmentName != null">equipment_name = #{equipmentName},</if>
|
<if test="workshopCode != null">workshop_code = #{workshopCode},</if>
|
<if test="productionLineCode != null">production_line_code = #{productionLineCode},</if>
|
<if test="processesCode != null">processes_code = #{processesCode},</if>
|
<if test="eqStatus != null">eq_status = #{eqStatus},</if>
|
<if test="spareField1 != null">spare_field_1 = #{spareField1},</if>
|
<if test="spareField2 != null">spare_field_2 = #{spareField2},</if>
|
<if test="remarks != null">remarks = #{remarks},</if>
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<delete id="deleteEmEquipmentStatusById" parameterType="Long">
|
delete from em_equipment_status where id = #{id}
|
</delete>
|
|
<delete id="deleteEmEquipmentStatusByIds" parameterType="String">
|
delete from em_equipment_status where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
</mapper>
|