提交 | 用户 | 时间
|
fd2207
|
1 |
<?xml version="1.0" encoding="UTF-8" ?> |
懒 |
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.om.productionOrde.mapper.OmProductionOrdeInfoMapper"> |
|
6 |
|
|
7 |
<resultMap type="OmProductionOrdeInfo" id="OmProductionOrdeInfoResult"> |
|
8 |
<result property="id" column="id" /> |
|
9 |
<result property="workOrderNo" column="work_order_no" /> |
|
10 |
<result property="salesOrderCode" column="sales_order_code" /> |
|
11 |
<result property="productCode" column="product_code" /> |
|
12 |
<result property="productName" column="product_name" /> |
|
13 |
<result property="workshopCode" column="workshop_code" /> |
|
14 |
<result property="lineCode" column="line_code" /> |
|
15 |
<result property="routeCode" column="route_code" /> |
|
16 |
<result property="bomCode" column="bom_code" /> |
|
17 |
<result property="recipeCode" column="recipe_code" /> |
|
18 |
<result property="planQty" column="plan_qty" /> |
|
19 |
<result property="actualQty" column="actual_qty" /> |
|
20 |
<result property="badQty" column="bad_qty" /> |
|
21 |
<result property="scrapQty" column="scrap_qty" /> |
|
22 |
<result property="repairQty" column="repair_qty" /> |
|
23 |
<result property="actualOnlineQty" column="actual_online_qty" /> |
|
24 |
<result property="onlineCompletionMark" column="online_completion_mark" /> |
|
25 |
<result property="demandDate" column="demand_date" /> |
|
26 |
<result property="planStartTime" column="plan_start_time" /> |
|
27 |
<result property="planEndTime" column="plan_end_time" /> |
|
28 |
<result property="actualStartTime" column="actual_start_time" /> |
|
29 |
<result property="actualEndTime" column="actual_end_time" /> |
|
30 |
<result property="serialNumber" column="serial_number" /> |
|
31 |
<result property="orderStatus" column="order_status" /> |
|
32 |
<result property="createTime" column="create_time" /> |
|
33 |
<result property="updateTime" column="update_time" /> |
|
34 |
<result property="createUser" column="create_user" /> |
|
35 |
<result property="updateUser" column="update_user" /> |
|
36 |
<result property="remarks" column="remarks" /> |
|
37 |
<result property="streamNumber" column="stream_number" /> |
|
38 |
<result property="custom" column="custom" /> |
|
39 |
<result property="marketAreaCode" column="market_area_code" /> |
|
40 |
<result property="softwareVersionCode" column="software_version_code" /> |
|
41 |
<result property="productCompanyCode" column="product_company_code" /> |
|
42 |
<result property="spareField1" column="spare_field_1" /> |
|
43 |
<result property="spareField2" column="spare_field_2" /> |
|
44 |
<result property="spareField3" column="spare_field_3" /> |
|
45 |
<result property="spareField4" column="spare_field_4" /> |
065fe8
|
46 |
<result property="typeZ" column="type_z" /> |
df1f2b
|
47 |
<result property="productionNotice" column="production_notice" /> |
懒 |
48 |
|
fd2207
|
49 |
</resultMap> |
懒 |
50 |
|
|
51 |
<sql id="selectOmProductionOrdeInfoVo"> |
df1f2b
|
52 |
select id, work_order_no, sales_order_code,type_z,product_code, product_name, workshop_code, line_code, route_code, bom_code, recipe_code, plan_qty, actual_qty, bad_qty, scrap_qty, repair_qty, actual_online_qty, online_completion_mark, demand_date, plan_start_time, plan_end_time, actual_start_time, actual_end_time, serial_number, order_status, create_time, update_time, create_user, update_user, remarks, stream_number, custom, market_area_code, software_version_code, product_company_code, spare_field_1, spare_field_2, spare_field_3, spare_field_4, production_notice from om_production_orde_info |
fd2207
|
53 |
</sql> |
懒 |
54 |
|
|
55 |
<select id="selectOmProductionOrdeInfoList" parameterType="OmProductionOrdeInfo" resultMap="OmProductionOrdeInfoResult"> |
|
56 |
<include refid="selectOmProductionOrdeInfoVo"/> |
|
57 |
<where> |
|
58 |
<if test="id != null and id != ''"> and id like concat('%', #{id}, '%')</if> |
|
59 |
<if test="workOrderNo != null and workOrderNo != ''"> and work_order_no like concat('%', #{workOrderNo}, '%')</if> |
|
60 |
<if test="salesOrderCode != null and salesOrderCode != ''"> and sales_order_code like concat('%', #{salesOrderCode}, '%')</if> |
|
61 |
<if test="productCode != null and productCode != ''"> and product_code like concat('%', #{productCode}, '%')</if> |
|
62 |
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if> |
|
63 |
<if test="workshopCode != null and workshopCode != ''"> and workshop_code like concat('%', #{workshopCode}, '%')</if> |
|
64 |
<if test="lineCode != null and lineCode != ''"> and line_code like concat('%', #{lineCode}, '%')</if> |
|
65 |
<if test="routeCode != null and routeCode != ''"> and route_code like concat('%', #{routeCode}, '%')</if> |
|
66 |
<if test="bomCode != null and bomCode != ''"> and bom_code like concat('%', #{bomCode}, '%')</if> |
|
67 |
<if test="recipeCode != null and recipeCode != ''"> and recipe_code like concat('%', #{recipeCode}, '%')</if> |
|
68 |
<if test="orderStatus != null and orderStatus != ''"> and order_status = #{orderStatus}</if> |
|
69 |
<if test="custom != null and custom != ''"> and custom like concat('%', #{custom}, '%')</if> |
|
70 |
<if test="marketAreaCode != null and marketAreaCode != ''"> and market_area_code like concat('%', #{marketAreaCode}, '%')</if> |
065fe8
|
71 |
<if test="typeZ != null and typeZ != ''"> and type_z like concat('%', #{typeZ}, '%')</if> |
fd2207
|
72 |
<if test="softwareVersionCode != null and softwareVersionCode != ''"> and software_version_code like concat('%', #{softwareVersionCode}, '%')</if> |
懒 |
73 |
<if test="productCompanyCode != null and productCompanyCode != ''"> and product_company_code like concat('%', #{productCompanyCode}, '%')</if> |
df1f2b
|
74 |
<if test="productionNotice != null and productionNotice != ''"> and production_notice like concat('%', #{productionNotice}, '%')</if> |
162d0b
|
75 |
<if test="dateConditions != null and dateConditions != ''"> and create_time BETWEEN #{startTime} AND #{endTime}</if> |
df1f2b
|
76 |
|
fd2207
|
77 |
</where> |
7dc046
|
78 |
ORDER BY CAST(work_order_no AS BIGINT) DESC |
fd2207
|
79 |
</select> |
懒 |
80 |
|
|
81 |
<select id="selectOmProductionOrdeInfoById" parameterType="Long" resultMap="OmProductionOrdeInfoResult"> |
|
82 |
<include refid="selectOmProductionOrdeInfoVo"/> |
|
83 |
where id = #{id} |
|
84 |
</select> |
d4f437
|
85 |
|
Y |
86 |
<select id="selectOmProductionOrdeInfoByIds" parameterType="String" resultMap="OmProductionOrdeInfoResult"> |
|
87 |
select type_z,product_code,line_code,route_code, bom_code, recipe_code, sum(plan_qty) plan_qty,serial_number, order_status from om_production_orde_info |
|
88 |
where id in |
|
89 |
<foreach item="id" collection="array" open="(" separator="," close=")"> |
|
90 |
#{id} |
|
91 |
</foreach> |
|
92 |
GROUP BY type_z,product_code,line_code,route_code, bom_code, recipe_code,serial_number, order_status |
|
93 |
</select> |
fd2207
|
94 |
|
懒 |
95 |
<insert id="insertOmProductionOrdeInfo" parameterType="OmProductionOrdeInfo"> |
|
96 |
insert into om_production_orde_info |
|
97 |
<trim prefix="(" suffix=")" suffixOverrides=","> |
|
98 |
<if test="id != null">id,</if> |
|
99 |
<if test="workOrderNo != null">work_order_no,</if> |
065fe8
|
100 |
<if test="typeZ != null">type_z,</if> |
fd2207
|
101 |
<if test="salesOrderCode != null">sales_order_code,</if> |
懒 |
102 |
<if test="productCode != null">product_code,</if> |
|
103 |
<if test="productName != null">product_name,</if> |
|
104 |
<if test="workshopCode != null">workshop_code,</if> |
|
105 |
<if test="lineCode != null">line_code,</if> |
|
106 |
<if test="routeCode != null">route_code,</if> |
|
107 |
<if test="bomCode != null">bom_code,</if> |
|
108 |
<if test="recipeCode != null">recipe_code,</if> |
|
109 |
<if test="planQty != null">plan_qty,</if> |
|
110 |
<if test="actualQty != null">actual_qty,</if> |
|
111 |
<if test="badQty != null">bad_qty,</if> |
|
112 |
<if test="scrapQty != null">scrap_qty,</if> |
|
113 |
<if test="repairQty != null">repair_qty,</if> |
|
114 |
<if test="actualOnlineQty != null">actual_online_qty,</if> |
|
115 |
<if test="onlineCompletionMark != null">online_completion_mark,</if> |
|
116 |
<if test="demandDate != null">demand_date,</if> |
|
117 |
<if test="planStartTime != null">plan_start_time,</if> |
|
118 |
<if test="planEndTime != null">plan_end_time,</if> |
|
119 |
<if test="actualStartTime != null">actual_start_time,</if> |
|
120 |
<if test="actualEndTime != null">actual_end_time,</if> |
|
121 |
<if test="serialNumber != null">serial_number,</if> |
|
122 |
<if test="orderStatus != null">order_status,</if> |
|
123 |
<if test="createTime != null">create_time,</if> |
|
124 |
<if test="updateTime != null">update_time,</if> |
|
125 |
<if test="createUser != null">create_user,</if> |
|
126 |
<if test="updateUser != null">update_user,</if> |
|
127 |
<if test="remarks != null">remarks,</if> |
|
128 |
<if test="streamNumber != null">stream_number,</if> |
|
129 |
<if test="custom != null">custom,</if> |
|
130 |
<if test="marketAreaCode != null">market_area_code,</if> |
|
131 |
<if test="softwareVersionCode != null">software_version_code,</if> |
|
132 |
<if test="productCompanyCode != null">product_company_code,</if> |
|
133 |
<if test="spareField1 != null">spare_field_1,</if> |
|
134 |
<if test="spareField2 != null">spare_field_2,</if> |
|
135 |
<if test="spareField3 != null">spare_field_3,</if> |
|
136 |
<if test="spareField4 != null">spare_field_4,</if> |
df1f2b
|
137 |
<if test="productionNotice != null">production_notice,</if> |
懒 |
138 |
|
|
139 |
</trim> |
fd2207
|
140 |
<trim prefix="values (" suffix=")" suffixOverrides=","> |
懒 |
141 |
<if test="id != null">#{id},</if> |
|
142 |
<if test="workOrderNo != null">#{workOrderNo},</if> |
065fe8
|
143 |
<if test="typeZ != null">#{typeZ},</if> |
fd2207
|
144 |
<if test="salesOrderCode != null">#{salesOrderCode},</if> |
懒 |
145 |
<if test="productCode != null">#{productCode},</if> |
|
146 |
<if test="productName != null">#{productName},</if> |
|
147 |
<if test="workshopCode != null">#{workshopCode},</if> |
|
148 |
<if test="lineCode != null">#{lineCode},</if> |
|
149 |
<if test="routeCode != null">#{routeCode},</if> |
|
150 |
<if test="bomCode != null">#{bomCode},</if> |
|
151 |
<if test="recipeCode != null">#{recipeCode},</if> |
|
152 |
<if test="planQty != null">#{planQty},</if> |
|
153 |
<if test="actualQty != null">#{actualQty},</if> |
|
154 |
<if test="badQty != null">#{badQty},</if> |
|
155 |
<if test="scrapQty != null">#{scrapQty},</if> |
|
156 |
<if test="repairQty != null">#{repairQty},</if> |
|
157 |
<if test="actualOnlineQty != null">#{actualOnlineQty},</if> |
|
158 |
<if test="onlineCompletionMark != null">#{onlineCompletionMark},</if> |
|
159 |
<if test="demandDate != null">#{demandDate},</if> |
|
160 |
<if test="planStartTime != null">#{planStartTime},</if> |
|
161 |
<if test="planEndTime != null">#{planEndTime},</if> |
|
162 |
<if test="actualStartTime != null">#{actualStartTime},</if> |
|
163 |
<if test="actualEndTime != null">#{actualEndTime},</if> |
|
164 |
<if test="serialNumber != null">#{serialNumber},</if> |
|
165 |
<if test="orderStatus != null">#{orderStatus},</if> |
|
166 |
<if test="createTime != null">#{createTime},</if> |
|
167 |
<if test="updateTime != null">#{updateTime},</if> |
|
168 |
<if test="createUser != null">#{createUser},</if> |
|
169 |
<if test="updateUser != null">#{updateUser},</if> |
|
170 |
<if test="remarks != null">#{remarks},</if> |
|
171 |
<if test="streamNumber != null">#{streamNumber},</if> |
|
172 |
<if test="custom != null">#{custom},</if> |
|
173 |
<if test="marketAreaCode != null">#{marketAreaCode},</if> |
|
174 |
<if test="softwareVersionCode != null">#{softwareVersionCode},</if> |
|
175 |
<if test="productCompanyCode != null">#{productCompanyCode},</if> |
|
176 |
<if test="spareField1 != null">#{spareField1},</if> |
|
177 |
<if test="spareField2 != null">#{spareField2},</if> |
|
178 |
<if test="spareField3 != null">#{spareField3},</if> |
|
179 |
<if test="spareField4 != null">#{spareField4},</if> |
df1f2b
|
180 |
<if test="productionNotice != null">#{productionNotice},</if> |
懒 |
181 |
|
|
182 |
</trim> |
fd2207
|
183 |
</insert> |
懒 |
184 |
|
|
185 |
<update id="updateOmProductionOrdeInfo" parameterType="OmProductionOrdeInfo"> |
|
186 |
update om_production_orde_info |
|
187 |
<trim prefix="SET" suffixOverrides=","> |
|
188 |
<if test="workOrderNo != null">work_order_no = #{workOrderNo},</if> |
|
189 |
<if test="salesOrderCode != null">sales_order_code = #{salesOrderCode},</if> |
|
190 |
<if test="productCode != null">product_code = #{productCode},</if> |
065fe8
|
191 |
<if test="typeZ != null">type_z = #{typeZ},</if> |
fd2207
|
192 |
<if test="productName != null">product_name = #{productName},</if> |
懒 |
193 |
<if test="workshopCode != null">workshop_code = #{workshopCode},</if> |
|
194 |
<if test="lineCode != null">line_code = #{lineCode},</if> |
|
195 |
<if test="routeCode != null">route_code = #{routeCode},</if> |
|
196 |
<if test="bomCode != null">bom_code = #{bomCode},</if> |
|
197 |
<if test="recipeCode != null">recipe_code = #{recipeCode},</if> |
|
198 |
<if test="planQty != null">plan_qty = #{planQty},</if> |
|
199 |
<if test="actualQty != null">actual_qty = #{actualQty},</if> |
|
200 |
<if test="badQty != null">bad_qty = #{badQty},</if> |
|
201 |
<if test="scrapQty != null">scrap_qty = #{scrapQty},</if> |
|
202 |
<if test="repairQty != null">repair_qty = #{repairQty},</if> |
|
203 |
<if test="actualOnlineQty != null">actual_online_qty = #{actualOnlineQty},</if> |
|
204 |
<if test="onlineCompletionMark != null">online_completion_mark = #{onlineCompletionMark},</if> |
|
205 |
<if test="demandDate != null">demand_date = #{demandDate},</if> |
|
206 |
<if test="planStartTime != null">plan_start_time = #{planStartTime},</if> |
|
207 |
<if test="planEndTime != null">plan_end_time = #{planEndTime},</if> |
|
208 |
<if test="actualStartTime != null">actual_start_time = #{actualStartTime},</if> |
|
209 |
<if test="actualEndTime != null">actual_end_time = #{actualEndTime},</if> |
|
210 |
<if test="serialNumber != null">serial_number = #{serialNumber},</if> |
|
211 |
<if test="orderStatus != null">order_status = #{orderStatus},</if> |
|
212 |
<if test="createTime != null">create_time = #{createTime},</if> |
|
213 |
<if test="updateTime != null">update_time = #{updateTime},</if> |
|
214 |
<if test="createUser != null">create_user = #{createUser},</if> |
|
215 |
<if test="updateUser != null">update_user = #{updateUser},</if> |
|
216 |
<if test="remarks != null">remarks = #{remarks},</if> |
|
217 |
<if test="streamNumber != null">stream_number = #{streamNumber},</if> |
|
218 |
<if test="custom != null">custom = #{custom},</if> |
|
219 |
<if test="marketAreaCode != null">market_area_code = #{marketAreaCode},</if> |
|
220 |
<if test="softwareVersionCode != null">software_version_code = #{softwareVersionCode},</if> |
|
221 |
<if test="productCompanyCode != null">product_company_code = #{productCompanyCode},</if> |
|
222 |
<if test="spareField1 != null">spare_field_1 = #{spareField1},</if> |
|
223 |
<if test="spareField2 != null">spare_field_2 = #{spareField2},</if> |
|
224 |
<if test="spareField3 != null">spare_field_3 = #{spareField3},</if> |
|
225 |
<if test="spareField4 != null">spare_field_4 = #{spareField4},</if> |
df1f2b
|
226 |
<if test="productionNotice != null">production_notice = #{productionNotice},</if> |
懒 |
227 |
|
fd2207
|
228 |
</trim> |
懒 |
229 |
where id = #{id} |
|
230 |
</update> |
|
231 |
|
|
232 |
<delete id="deleteOmProductionOrdeInfoById" parameterType="Long"> |
|
233 |
delete from om_production_orde_info where id = #{id} |
|
234 |
</delete> |
|
235 |
|
|
236 |
<delete id="deleteOmProductionOrdeInfoByIds" parameterType="String"> |
|
237 |
delete from om_production_orde_info where id in |
|
238 |
<foreach item="id" collection="array" open="(" separator="," close=")"> |
|
239 |
#{id} |
|
240 |
</foreach> |
|
241 |
</delete> |
|
242 |
|
|
243 |
<select id="getMaxStreamNumber" resultType="Integer"> |
|
244 |
SELECT MAX(stream_number) AS streamNumber FROM om_production_orde_info |
|
245 |
</select> |
|
246 |
</mapper> |