提交 | 用户 | 时间
|
0cceb6
|
1 |
<?xml version="1.0" encoding="UTF-8" ?> |
Y |
2 |
<!DOCTYPE mapper |
|
3 |
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
4 |
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|
5 |
<mapper namespace="com.jcdm.main.bs.lineInfo.mapper.BsLineInfoMapper"> |
|
6 |
|
|
7 |
<resultMap type="BsLineInfo" id="BsLineInfoResult"> |
|
8 |
<result property="id" column="id" /> |
|
9 |
<result property="lineCode" column="line_code" /> |
|
10 |
<result property="lineName" column="line_name" /> |
|
11 |
<result property="workshopCode" column="workshop_code" /> |
|
12 |
<result property="workCalendar" column="work_calendar" /> |
|
13 |
<result property="spareField1" column="spare_field_1" /> |
|
14 |
<result property="spareField2" column="spare_field_2" /> |
|
15 |
<result property="remarks" column="remarks" /> |
|
16 |
<result property="createUser" column="create_user" /> |
|
17 |
<result property="createTime" column="create_time" /> |
|
18 |
<result property="updateUser" column="update_user" /> |
|
19 |
<result property="updateTime" column="update_time" /> |
|
20 |
<result property="workshopName" column="workshop_name" /> |
|
21 |
<result property="status" column="status" /> |
|
22 |
</resultMap> |
|
23 |
|
|
24 |
<sql id="selectBsLineInfoVo"> |
|
25 |
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 |
|
26 |
</sql> |
|
27 |
|
|
28 |
<select id="selectBsLineInfoList" parameterType="BsLineInfo" resultMap="BsLineInfoResult"> |
|
29 |
<include refid="selectBsLineInfoVo"/> |
|
30 |
<where> |
|
31 |
<if test="lineCode != null and lineCode != ''"> and line_code like concat('%', #{lineCode}, '%')</if> |
|
32 |
<if test="lineName != null and lineName != ''"> and line_name like concat('%', #{lineName}, '%')</if> |
|
33 |
<if test="workshopCode != null and workshopCode != ''"> and workshop_code like concat('%', #{workshopCode}, '%')</if> |
|
34 |
<if test="workCalendar != null and workCalendar != ''"> and work_calendar = #{workCalendar}</if> |
|
35 |
</where> |
|
36 |
</select> |
|
37 |
|
|
38 |
<select id="selectBsLineInfoById" parameterType="Long" resultMap="BsLineInfoResult"> |
|
39 |
<include refid="selectBsLineInfoVo"/> |
|
40 |
where id = #{id} |
|
41 |
</select> |
|
42 |
|
|
43 |
<insert id="insertBsLineInfo" parameterType="BsLineInfo" useGeneratedKeys="true" keyProperty="id"> |
|
44 |
insert into bs_line_info |
|
45 |
<trim prefix="(" suffix=")" suffixOverrides=","> |
|
46 |
<if test="lineCode != null and lineCode != ''">line_code,</if> |
|
47 |
<if test="lineName != null and lineName != ''">line_name,</if> |
|
48 |
<if test="workshopCode != null and workshopCode != ''">workshop_code,</if> |
|
49 |
<if test="workCalendar != null">work_calendar,</if> |
|
50 |
<if test="spareField1 != null">spare_field_1,</if> |
|
51 |
<if test="spareField2 != null">spare_field_2,</if> |
|
52 |
<if test="remarks != null">remarks,</if> |
|
53 |
<if test="createUser != null">create_user,</if> |
|
54 |
<if test="createTime != null">create_time,</if> |
|
55 |
<if test="updateUser != null">update_user,</if> |
|
56 |
<if test="updateTime != null">update_time,</if> |
|
57 |
<if test="workshopName != null">workshop_name,</if> |
|
58 |
<if test="status != null">status,</if> |
|
59 |
</trim> |
|
60 |
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|
61 |
<if test="lineCode != null and lineCode != ''">#{lineCode},</if> |
|
62 |
<if test="lineName != null and lineName != ''">#{lineName},</if> |
|
63 |
<if test="workshopCode != null and workshopCode != ''">#{workshopCode},</if> |
|
64 |
<if test="workCalendar != null">#{workCalendar},</if> |
|
65 |
<if test="spareField1 != null">#{spareField1},</if> |
|
66 |
<if test="spareField2 != null">#{spareField2},</if> |
|
67 |
<if test="remarks != null">#{remarks},</if> |
|
68 |
<if test="createUser != null">#{createUser},</if> |
|
69 |
<if test="createTime != null">#{createTime},</if> |
|
70 |
<if test="updateUser != null">#{updateUser},</if> |
|
71 |
<if test="updateTime != null">#{updateTime},</if> |
|
72 |
<if test="workshopName != null">#{workshopName},</if> |
|
73 |
<if test="status != null">#{status},</if> |
|
74 |
</trim> |
|
75 |
</insert> |
|
76 |
|
|
77 |
<update id="updateBsLineInfo" parameterType="BsLineInfo"> |
|
78 |
update bs_line_info |
|
79 |
<trim prefix="SET" suffixOverrides=","> |
|
80 |
<if test="lineCode != null and lineCode != ''">line_code = #{lineCode},</if> |
|
81 |
<if test="lineName != null and lineName != ''">line_name = #{lineName},</if> |
|
82 |
<if test="workshopCode != null and workshopCode != ''">workshop_code = #{workshopCode},</if> |
|
83 |
<if test="workCalendar != null">work_calendar = #{workCalendar},</if> |
|
84 |
<if test="spareField1 != null">spare_field_1 = #{spareField1},</if> |
|
85 |
<if test="spareField2 != null">spare_field_2 = #{spareField2},</if> |
|
86 |
<if test="remarks != null">remarks = #{remarks},</if> |
|
87 |
<if test="createUser != null">create_user = #{createUser},</if> |
|
88 |
<if test="createTime != null">create_time = #{createTime},</if> |
|
89 |
<if test="updateUser != null">update_user = #{updateUser},</if> |
|
90 |
<if test="updateTime != null">update_time = #{updateTime},</if> |
|
91 |
<if test="workshopName != null">workshop_name = #{workshopName},</if> |
|
92 |
<if test="status != null">status = #{status},</if> |
|
93 |
</trim> |
|
94 |
where id = #{id} |
|
95 |
</update> |
|
96 |
|
|
97 |
<delete id="deleteBsLineInfoById" parameterType="Long"> |
|
98 |
delete from bs_line_info where id = #{id} |
|
99 |
</delete> |
|
100 |
|
|
101 |
<delete id="deleteBsLineInfoByIds" parameterType="String"> |
|
102 |
delete from bs_line_info where id in |
|
103 |
<foreach item="id" collection="array" open="(" separator="," close=")"> |
|
104 |
#{id} |
|
105 |
</foreach> |
|
106 |
</delete> |
|
107 |
</mapper> |