<?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.bs.batchInfo.mapper.BsBatchInfoMapper">
|
|
<resultMap type="BsBatchInfo" id="BsBatchInfoResult">
|
<result property="id" column="id" />
|
<result property="materialCode" column="material_code" />
|
<result property="materialName" column="material_name" />
|
<result property="batch" column="batch" />
|
<result property="changeTime" column="change_time" />
|
<result property="remarks" column="remarks" />
|
<result property="createTime" column="create_time" />
|
<result property="createUser" column="create_user" />
|
<result property="updateTime" column="update_time" />
|
<result property="updateUser" column="update_user" />
|
<result property="stationCode" column="station_code" />
|
<result property="flag" column="flag" />
|
|
</resultMap>
|
|
<sql id="selectBsBatchInfoVo">
|
select station_code, flag, id, material_code, material_name, batch, change_time, remarks, create_time, create_user, update_time, update_user from bs_batch_info
|
</sql>
|
|
<select id="selectBsBatchInfoList" parameterType="BsBatchInfo" resultMap="BsBatchInfoResult">
|
<include refid="selectBsBatchInfoVo"/>
|
<where>
|
<if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if>
|
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
|
<if test="batch != null and batch != ''"> and batch = #{batch}</if>
|
<if test="flag != null and flag != ''"> and flag = #{flag}</if>
|
<if test="stationCode != null and stationCode != ''"> and station_code = #{stationCode}</if>
|
|
</where>
|
</select>
|
|
<select id="selectBsBatchInfoById" parameterType="Long" resultMap="BsBatchInfoResult">
|
<include refid="selectBsBatchInfoVo"/>
|
where id = #{id}
|
</select>
|
|
<insert id="insertBsBatchInfo" parameterType="BsBatchInfo">
|
insert into bs_batch_info
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">id,</if>
|
<if test="materialCode != null">material_code,</if>
|
<if test="materialName != null">material_name,</if>
|
<if test="batch != null">batch,</if>
|
<if test="changeTime != null">change_time,</if>
|
<if test="remarks != null">remarks,</if>
|
<if test="createTime != null">create_time,</if>
|
<if test="createUser != null">create_user,</if>
|
<if test="updateTime != null">update_time,</if>
|
<if test="updateUser != null">update_user,</if>
|
<if test="stationCode != null">station_code,</if>
|
<if test="flag != null">flag,</if>
|
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="id != null">#{id},</if>
|
<if test="materialCode != null">#{materialCode},</if>
|
<if test="materialName != null">#{materialName},</if>
|
<if test="batch != null">#{batch},</if>
|
<if test="changeTime != null">#{changeTime},</if>
|
<if test="remarks != null">#{remarks},</if>
|
<if test="createTime != null">#{createTime},</if>
|
<if test="createUser != null">#{createUser},</if>
|
<if test="updateTime != null">#{updateTime},</if>
|
<if test="updateUser != null">#{updateUser},</if>
|
<if test="stationCode != null">#{stationCode},</if>
|
<if test="flag != null">#{flag},</if>
|
</trim>
|
</insert>
|
|
<update id="updateBsBatchInfo" parameterType="BsBatchInfo">
|
update bs_batch_info
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="materialCode != null">material_code = #{materialCode},</if>
|
<if test="materialName != null">material_name = #{materialName},</if>
|
<if test="batch != null">batch = #{batch},</if>
|
<if test="changeTime != null">change_time = #{changeTime},</if>
|
<if test="remarks != null">remarks = #{remarks},</if>
|
<if test="createTime != null">create_time = #{createTime},</if>
|
<if test="createUser != null">create_user = #{createUser},</if>
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
<if test="updateUser != null">update_user = #{updateUser},</if>
|
<if test="stationCode != null">station_code = #{stationCode},</if>
|
<if test="flag != null">flag = #{flag},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<delete id="deleteBsBatchInfoById" parameterType="Long">
|
delete from bs_batch_info where id = #{id}
|
</delete>
|
|
<delete id="deleteBsBatchInfoByIds" parameterType="String">
|
delete from bs_batch_info where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
</mapper>
|