懒羊羊
2023-11-14 ee4d94defe7cc7f36f87aebf2e9efed38ba93a40
提交 | 用户 | 时间
1ac2bc 1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 <mapper namespace="cn.stylefeng.guns.modular.zsx.pm.workOrder.mapper.WorkOrderMapper">
4
5     <!-- 通用查询映射结果 -->
6     <resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.zsx.pm.workOrder.entity.WorkOrder">
7         <id column="id" property="id" />
8         <result column="work_order_code" property="workOrderCode" />
9         <result column="sales_order_code" property="salesOrderCode" />
10         <result column="product_code" property="productCode" />
11         <result column="product_name" property="productName" />
12         <result column="plan_qty" property="planQty" />
13         <result column="produce_qty" property="produceQty" />
14         <result column="online_qty" property="onlineQty" />
15         <result column="plan_start_time" property="planStartTime" />
16         <result column="plan_end_time" property="planEndTime" />
17         <result column="produce_start_time" property="produceStartTime" />
18         <result column="produce_end_time" property="produceEndTime" />
19         <result column="workshop_code" property="workshopCode" />
20         <result column="line_code" property="lineCode" />
21         <result column="state" property="state" />
22         <result column="bad_qty" property="badQty" />
23         <result column="repair_qty" property="repairQty" />
24         <result column="scrap_qty" property="scrapQty" />
25         <result column="route_code" property="routeCode" />
26         <result column="bom_code" property="bomCode" />
27         <result column="recipe_code" property="recipeCode" />
28         <result column="spare_field_1" property="spareField1" />
29         <result column="spare_field_2" property="spareField2" />
30         <result column="spare_field_3" property="spareField3" />
31         <result column="create_user" property="createUser" />
32         <result column="create_time" property="createTime" />
33         <result column="update_user" property="updateUser" />
34         <result column="update_time" property="updateTime" />
35         <result column="remark" property="remark" />
36     </resultMap>
37
38     <!-- 通用查询结果列 -->
39     <sql id="Base_Column_List">
40         id AS "id", work_order_code AS "workOrderCode", sales_order_code AS "salesOrderCode", product_code AS "productCode", product_name AS "productName", plan_qty AS "planQty", produce_qty AS "produceQty", online_qty AS "onlineQty", plan_start_time AS "planStartTime", plan_end_time AS "planEndTime", produce_start_time AS "produceStartTime", produce_end_time AS "produceEndTime", workshop_code AS "workshopCode", line_code AS "lineCode", state AS "state", bad_qty AS "badQty", repair_qty AS "repairQty", scrap_qty AS "scrapQty", route_code AS "routeCode", bom_code AS "bomCode", recipe_code AS "recipeCode", spare_field_1 AS "spareField1", spare_field_2 AS "spareField2", spare_field_3 AS "spareField3", create_user AS "createUser", create_time AS "createTime", update_user AS "updateUser", update_time AS "updateTime", remark AS "remark"
41     </sql>
42
43
44     <select id="customList" resultType="cn.stylefeng.guns.modular.zsx.pm.workOrder.model.result.WorkOrderResult" parameterType="cn.stylefeng.guns.modular.zsx.pm.workOrder.model.params.WorkOrderParam">
45         select
46         <include refid="Base_Column_List"/>
47         from pm_work_order where 1 = 1
48             <if test="paramCondition.workOrderCode != null and paramCondition.workOrderCode != ''">
49                 and work_order_code like CONCAT('%',#{paramCondition.workOrderCode},'%')
50             </if>
51             <if test="paramCondition.salesOrderCode != null and paramCondition.salesOrderCode != ''">
52                 and sales_order_code like CONCAT('%',#{paramCondition.salesOrderCode},'%')
53             </if>
54             <if test="paramCondition.productCode != null and paramCondition.productCode != ''">
55                 and product_code like CONCAT('%',#{paramCondition.productCode},'%')
56             </if>
57             <if test="paramCondition.productName != null and paramCondition.productName != ''">
58                 and product_name like CONCAT('%',#{paramCondition.productName},'%')
59             </if>
60             <if test="paramCondition.workshopCode != null and paramCondition.workshopCode != ''">
61                 and workshop_code like CONCAT('%',#{paramCondition.workshopCode},'%')
62             </if>
63             <if test="paramCondition.lineCode != null and paramCondition.lineCode != ''">
64                 and line_code like CONCAT('%',#{paramCondition.lineCode},'%')
65             </if>
66             <if test="paramCondition.state != null and paramCondition.state != ''">
67                 and state like CONCAT('%',#{paramCondition.state},'%')
68             </if>
69     </select>
70
71     <select id="customMapList" resultType="map" parameterType="cn.stylefeng.guns.modular.zsx.pm.workOrder.model.params.WorkOrderParam">
72         select
73         <include refid="Base_Column_List"/>
74         from pm_work_order where 1 = 1
75             <if test="paramCondition.workOrderCode != null and paramCondition.workOrderCode != ''">
76                 and work_order_code like CONCAT('%',#{paramCondition.workOrderCode},'%')
77             </if>
78             <if test="paramCondition.salesOrderCode != null and paramCondition.salesOrderCode != ''">
79                 and sales_order_code like CONCAT('%',#{paramCondition.salesOrderCode},'%')
80             </if>
81             <if test="paramCondition.productCode != null and paramCondition.productCode != ''">
82                 and product_code like CONCAT('%',#{paramCondition.productCode},'%')
83             </if>
84             <if test="paramCondition.productName != null and paramCondition.productName != ''">
85                 and product_name like CONCAT('%',#{paramCondition.productName},'%')
86             </if>
87             <if test="paramCondition.workshopCode != null and paramCondition.workshopCode != ''">
88                 and workshop_code like CONCAT('%',#{paramCondition.workshopCode},'%')
89             </if>
90             <if test="paramCondition.lineCode != null and paramCondition.lineCode != ''">
91                 and line_code like CONCAT('%',#{paramCondition.lineCode},'%')
92             </if>
93             <if test="paramCondition.state != null and paramCondition.state != ''">
94                 and state like CONCAT('%',#{paramCondition.state},'%')
95             </if>
96     </select>
97
98     <select id="customPageList" resultType="cn.stylefeng.guns.modular.zsx.pm.workOrder.model.result.WorkOrderResult" parameterType="cn.stylefeng.guns.modular.zsx.pm.workOrder.model.params.WorkOrderParam">
99         select
100         <include refid="Base_Column_List"/>
101         from pm_work_order where 1 = 1
102             <if test="paramCondition.workOrderCode != null and paramCondition.workOrderCode != ''">
103                 and work_order_code like CONCAT('%',#{paramCondition.workOrderCode},'%')
104             </if>
105             <if test="paramCondition.salesOrderCode != null and paramCondition.salesOrderCode != ''">
106                 and sales_order_code like CONCAT('%',#{paramCondition.salesOrderCode},'%')
107             </if>
108             <if test="paramCondition.productCode != null and paramCondition.productCode != ''">
109                 and product_code like CONCAT('%',#{paramCondition.productCode},'%')
110             </if>
111             <if test="paramCondition.productName != null and paramCondition.productName != ''">
112                 and product_name like CONCAT('%',#{paramCondition.productName},'%')
113             </if>
114             <if test="paramCondition.workshopCode != null and paramCondition.workshopCode != ''">
115                 and workshop_code like CONCAT('%',#{paramCondition.workshopCode},'%')
116             </if>
117             <if test="paramCondition.lineCode != null and paramCondition.lineCode != ''">
118                 and line_code like CONCAT('%',#{paramCondition.lineCode},'%')
119             </if>
120             <if test="paramCondition.state != null and paramCondition.state != ''">
121                 and state like CONCAT('%',#{paramCondition.state},'%')
122             </if>
123     </select>
124
125     <select id="customPageMapList" resultType="map" parameterType="cn.stylefeng.guns.modular.zsx.pm.workOrder.model.params.WorkOrderParam">
126         select
127         <include refid="Base_Column_List"/>
128         from pm_work_order where 1 = 1
129             <if test="paramCondition.workOrderCode != null and paramCondition.workOrderCode != ''">
130                 and work_order_code like CONCAT('%',#{paramCondition.workOrderCode},'%')
131             </if>
132             <if test="paramCondition.salesOrderCode != null and paramCondition.salesOrderCode != ''">
133                 and sales_order_code like CONCAT('%',#{paramCondition.salesOrderCode},'%')
134             </if>
135             <if test="paramCondition.productCode != null and paramCondition.productCode != ''">
136                 and product_code like CONCAT('%',#{paramCondition.productCode},'%')
137             </if>
138             <if test="paramCondition.productName != null and paramCondition.productName != ''">
139                 and product_name like CONCAT('%',#{paramCondition.productName},'%')
140             </if>
141             <if test="paramCondition.workshopCode != null and paramCondition.workshopCode != ''">
142                 and workshop_code like CONCAT('%',#{paramCondition.workshopCode},'%')
143             </if>
144             <if test="paramCondition.lineCode != null and paramCondition.lineCode != ''">
145                 and line_code like CONCAT('%',#{paramCondition.lineCode},'%')
146             </if>
147             <if test="paramCondition.state != null and paramCondition.state != ''">
148                 and state like CONCAT('%',#{paramCondition.state},'%')
149             </if>
150     </select>
151
152 </mapper>