<?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.modelNumber.mapper.BsModelNumberMapper">
|
|
<resultMap type="BsModelNumber" id="BsModelNumberResult">
|
<result property="id" column="id" />
|
<result property="model" column="model" />
|
<result property="modelDate" column="model_date" />
|
<result property="maxnumValue" column="maxnum_value" />
|
<result property="saveTime" column="save_time" />
|
<result property="lastNumber" column="last_number" />
|
<result property="status" column="status" />
|
<result property="spareField1" column="spare_field_1" />
|
<result property="spareField2" column="spare_field_2" />
|
<result property="spareField3" column="spare_field_3" />
|
<result property="spareField4" column="spare_field_4" />
|
<result property="createUser" column="create_user" />
|
<result property="createTime" column="create_time" />
|
<result property="updateUser" column="update_user" />
|
<result property="updateTime" column="update_time" />
|
<result property="remarks" column="remarks" />
|
</resultMap>
|
|
<sql id="selectBsModelNumberVo">
|
select id, model, model_date, maxnum_value, save_time, last_number, status, spare_field_1, spare_field_2, spare_field_3, spare_field_4, create_user, create_time, update_user, update_time, remarks from bs_model_number
|
</sql>
|
|
<select id="selectBsModelNumberList" parameterType="BsModelNumber" resultMap="BsModelNumberResult">
|
<include refid="selectBsModelNumberVo"/>
|
<where>
|
<if test="model != null and model != ''"> and model = #{model}</if>
|
<if test="modelDate != null and modelDate != ''"> and model_date = #{modelDate}</if>
|
<if test="maxnumValue != null and maxnumValue != ''"> and maxnum_value = #{maxnumValue}</if>
|
<if test="saveTime != null and saveTime != ''"> and save_time = #{saveTime}</if>
|
<if test="lastNumber != null and lastNumber != ''"> and last_number = #{lastNumber}</if>
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
<if test="spareField1 != null and spareField1 != ''"> and spare_field_1 = #{spareField1}</if>
|
<if test="spareField2 != null and spareField2 != ''"> and spare_field_2 = #{spareField2}</if>
|
<if test="spareField3 != null and spareField3 != ''"> and spare_field_3 = #{spareField3}</if>
|
<if test="spareField4 != null and spareField4 != ''"> and spare_field_4 = #{spareField4}</if>
|
<if test="createUser != null and createUser != ''"> and create_user = #{createUser}</if>
|
<if test="updateUser != null and updateUser != ''"> and update_user = #{updateUser}</if>
|
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
|
</where>
|
ORDER BY save_time DESC
|
</select>
|
|
<select id="selectBsModelNumberById" parameterType="Long" resultMap="BsModelNumberResult">
|
<include refid="selectBsModelNumberVo"/>
|
where id = #{id}
|
</select>
|
|
<insert id="insertBsModelNumber" parameterType="BsModelNumber" useGeneratedKeys="true" keyProperty="id">
|
insert into bs_model_number
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="model != null">model,</if>
|
<if test="modelDate != null">model_date,</if>
|
<if test="maxnumValue != null">maxnum_value,</if>
|
<if test="saveTime != null">save_time,</if>
|
<if test="lastNumber != null">last_number,</if>
|
<if test="status != null">status,</if>
|
<if test="spareField1 != null">spare_field_1,</if>
|
<if test="spareField2 != null">spare_field_2,</if>
|
<if test="spareField3 != null">spare_field_3,</if>
|
<if test="spareField4 != null">spare_field_4,</if>
|
<if test="createUser != null">create_user,</if>
|
<if test="createTime != null">create_time,</if>
|
<if test="updateUser != null">update_user,</if>
|
<if test="updateTime != null">update_time,</if>
|
<if test="remarks != null">remarks,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="model != null">#{model},</if>
|
<if test="modelDate != null">#{modelDate},</if>
|
<if test="maxnumValue != null">#{maxnumValue},</if>
|
<if test="saveTime != null">#{saveTime},</if>
|
<if test="lastNumber != null">#{lastNumber},</if>
|
<if test="status != null">#{status},</if>
|
<if test="spareField1 != null">#{spareField1},</if>
|
<if test="spareField2 != null">#{spareField2},</if>
|
<if test="spareField3 != null">#{spareField3},</if>
|
<if test="spareField4 != null">#{spareField4},</if>
|
<if test="createUser != null">#{createUser},</if>
|
<if test="createTime != null">#{createTime},</if>
|
<if test="updateUser != null">#{updateUser},</if>
|
<if test="updateTime != null">#{updateTime},</if>
|
<if test="remarks != null">#{remarks},</if>
|
</trim>
|
</insert>
|
|
<update id="updateBsModelNumber" parameterType="BsModelNumber">
|
update bs_model_number
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="model != null">model = #{model},</if>
|
<if test="modelDate != null">model_date = #{modelDate},</if>
|
<if test="maxnumValue != null">maxnum_value = #{maxnumValue},</if>
|
<if test="saveTime != null">save_time = #{saveTime},</if>
|
<if test="lastNumber != null">last_number = #{lastNumber},</if>
|
<if test="status != null">status = #{status},</if>
|
<if test="spareField1 != null">spare_field_1 = #{spareField1},</if>
|
<if test="spareField2 != null">spare_field_2 = #{spareField2},</if>
|
<if test="spareField3 != null">spare_field_3 = #{spareField3},</if>
|
<if test="spareField4 != null">spare_field_4 = #{spareField4},</if>
|
<if test="createUser != null">create_user = #{createUser},</if>
|
<if test="createTime != null">create_time = #{createTime},</if>
|
<if test="updateUser != null">update_user = #{updateUser},</if>
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
<if test="remarks != null">remarks = #{remarks},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<delete id="deleteBsModelNumberById" parameterType="Long">
|
delete from bs_model_number where id = #{id}
|
</delete>
|
|
<delete id="deleteBsModelNumberByIds" parameterType="String">
|
delete from bs_model_number where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
</mapper>
|