<?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.aps.core.mapper.ApsGasPipelineMoMapper">
|
|
<resultMap type="com.aps.core.domain.ApsGasPipelineMo" id="ApsGasPipelineMoResult">
|
<result property="id" column="id" />
|
<result property="mo" column="mo" />
|
<result property="factory" column="factory" />
|
<result property="materialCode" column="material_code" />
|
<result property="planEnd" column="plan_end" />
|
<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="quantity" column="quantity" />
|
</resultMap>
|
|
<sql id="selectApsGasPipelineMoVo">
|
select id, mo, factory, material_code, plan_end, create_by, create_time, update_by, update_time, quantity from aps_gas_pipeline_mo
|
</sql>
|
|
<select id="selectApsGasPipelineMoList" parameterType="ApsGasPipelineMo" resultMap="ApsGasPipelineMoResult">
|
<include refid="selectApsGasPipelineMoVo"/>
|
<where>
|
<if test="mo != null and mo != ''"> and mo = #{mo}</if>
|
<if test="factory != null and factory != ''"> and factory = #{factory}</if>
|
<if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if>
|
<if test="planEnd != null and planEnd != ''"> and plan_end = #{planEnd}</if>
|
<if test="quantity != null and quantity != ''"> and quantity = #{quantity}</if>
|
</where>
|
order by create_time desc
|
</select>
|
|
<select id="selectApsGasPipelineMoById" parameterType="Long" resultMap="ApsGasPipelineMoResult">
|
</select>
|
|
<insert id="insertApsGasPipelineMo" parameterType="ApsGasPipelineMo">
|
insert into aps_gas_pipeline_mo
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">id,</if>
|
<if test="mo != null">mo,</if>
|
<if test="factory != null">factory,</if>
|
<if test="materialCode != null">material_code,</if>
|
<if test="planEnd != null">plan_end,</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>
|
<if test="quantity != null">quantity,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="id != null">#{id},</if>
|
<if test="mo != null">#{mo},</if>
|
<if test="factory != null">#{factory},</if>
|
<if test="materialCode != null">#{materialCode},</if>
|
<if test="planEnd != null">#{planEnd},</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>
|
<if test="quantity != null">#{quantity},</if>
|
</trim>
|
</insert>
|
|
<update id="updateApsGasPipelineMo" parameterType="ApsGasPipelineMo">
|
update aps_gas_pipeline_mo
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="mo != null">mo = #{mo},</if>
|
<if test="factory != null">factory = #{factory},</if>
|
<if test="materialCode != null">material_code = #{materialCode},</if>
|
<if test="planEnd != null">plan_end = #{planEnd},</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>
|
<if test="quantity != null">quantity = #{quantity},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<delete id="deleteApsGasPipelineMoById" parameterType="Long">
|
delete from aps_gas_pipeline_mo where id = #{id}
|
</delete>
|
|
<delete id="deleteAll">
|
delete from aps_gas_pipeline_mo
|
</delete>
|
|
<delete id="deleteApsGasPipelineMoByIds" parameterType="String">
|
delete from aps_gas_pipeline_mo where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
</mapper>
|