<?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.lineInfo.mapper.BsLineInfoMapper">
|
|
<resultMap type="BsLineInfo" id="BsLineInfoResult">
|
<result property="id" column="id" />
|
<result property="lineCode" column="line_code" />
|
<result property="lineName" column="line_name" />
|
<result property="workshopCode" column="workshop_code" />
|
<result property="workCalendar" column="work_calendar" />
|
<result property="spareField1" column="spare_field_1" />
|
<result property="spareField2" column="spare_field_2" />
|
<result property="remarks" column="remarks" />
|
<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="workshopName" column="workshop_name" />
|
<result property="status" column="status" />
|
</resultMap>
|
|
<sql id="selectBsLineInfoVo">
|
select id, line_code, line_name, workshop_code, work_calendar, spare_field_1, spare_field_2, remarks, create_user, create_time, update_user, update_time,workshop_name,status from bs_line_info
|
</sql>
|
|
<select id="selectBsLineInfoList" parameterType="BsLineInfo" resultMap="BsLineInfoResult">
|
<include refid="selectBsLineInfoVo"/>
|
<where>
|
<if test="lineCode != null and lineCode != ''"> and line_code like concat('%', #{lineCode}, '%')</if>
|
<if test="lineName != null and lineName != ''"> and line_name like concat('%', #{lineName}, '%')</if>
|
<if test="workshopCode != null and workshopCode != ''"> and workshop_code like concat('%', #{workshopCode}, '%')</if>
|
<if test="workCalendar != null and workCalendar != ''"> and work_calendar = #{workCalendar}</if>
|
</where>
|
</select>
|
|
<select id="selectBsLineInfoById" parameterType="Long" resultMap="BsLineInfoResult">
|
<include refid="selectBsLineInfoVo"/>
|
where id = #{id}
|
</select>
|
|
<insert id="insertBsLineInfo" parameterType="BsLineInfo" useGeneratedKeys="true" keyProperty="id">
|
insert into bs_line_info
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="lineCode != null and lineCode != ''">line_code,</if>
|
<if test="lineName != null and lineName != ''">line_name,</if>
|
<if test="workshopCode != null and workshopCode != ''">workshop_code,</if>
|
<if test="workCalendar != null">work_calendar,</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="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="workshopName != null">workshop_name,</if>
|
<if test="status != null">status,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="lineCode != null and lineCode != ''">#{lineCode},</if>
|
<if test="lineName != null and lineName != ''">#{lineName},</if>
|
<if test="workshopCode != null and workshopCode != ''">#{workshopCode},</if>
|
<if test="workCalendar != null">#{workCalendar},</if>
|
<if test="spareField1 != null">#{spareField1},</if>
|
<if test="spareField2 != null">#{spareField2},</if>
|
<if test="remarks != null">#{remarks},</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="workshopName != null">#{workshopName},</if>
|
<if test="status != null">#{status},</if>
|
</trim>
|
</insert>
|
|
<update id="updateBsLineInfo" parameterType="BsLineInfo">
|
update bs_line_info
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="lineCode != null and lineCode != ''">line_code = #{lineCode},</if>
|
<if test="lineName != null and lineName != ''">line_name = #{lineName},</if>
|
<if test="workshopCode != null and workshopCode != ''">workshop_code = #{workshopCode},</if>
|
<if test="workCalendar != null">work_calendar = #{workCalendar},</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="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="workshopName != null">workshop_name = #{workshopName},</if>
|
<if test="status != null">status = #{status},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<delete id="deleteBsLineInfoById" parameterType="Long">
|
delete from bs_line_info where id = #{id}
|
</delete>
|
|
<delete id="deleteBsLineInfoByIds" parameterType="String">
|
delete from bs_line_info where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
</mapper>
|