懒羊羊
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.salesOrder.mapper.SalesOrderMapper">
4
5     <!-- 通用查询映射结果 -->
6     <resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.zsx.pm.salesOrder.entity.SalesOrder">
7         <id column="id" property="id" />
8         <result column="sales_order_code" property="salesOrderCode" />
9         <result column="customer_no" property="customerNo" />
10         <result column="cargo_no" property="cargoNo" />
11         <result column="product_code" property="productCode" />
12         <result column="product_name" property="productName" />
13         <result column="plan_number" property="planNumber" />
14         <result column="plan_start_time" property="planStartTime" />
15         <result column="plan_end_time" property="planEndTime" />
16         <result column="workshop_code" property="workshopCode" />
17         <result column="line_code" property="lineCode" />
18         <result column="delivery_time" property="deliveryTime" />
19         <result column="state" property="state" />
20         <result column="order_source" property="orderSource" />
21         <result column="spare_field_1" property="spareField1" />
22         <result column="spare_field_2" property="spareField2" />
23         <result column="spare_field_3" property="spareField3" />
24         <result column="create_user" property="createUser" />
25         <result column="create_time" property="createTime" />
26         <result column="update_user" property="updateUser" />
27         <result column="update_time" property="updateTime" />
28         <result column="remark" property="remark" />
29     </resultMap>
30
31     <!-- 通用查询结果列 -->
32     <sql id="Base_Column_List">
33         id AS "id", sales_order_code AS "salesOrderCode", customer_no AS "customerNo", cargo_no AS "cargoNo", product_code AS "productCode", product_name AS "productName", plan_number AS "planNumber", plan_start_time AS "planStartTime", plan_end_time AS "planEndTime", workshop_code AS "workshopCode", line_code AS "lineCode", delivery_time AS "deliveryTime", state AS "state", order_source AS "orderSource", 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"
34     </sql>
35
36
37     <select id="customList" resultType="cn.stylefeng.guns.modular.zsx.pm.salesOrder.model.result.SalesOrderResult" parameterType="cn.stylefeng.guns.modular.zsx.pm.salesOrder.model.params.SalesOrderParam">
38         select
39         <include refid="Base_Column_List"/>
40         from pm_sales_order where 1 = 1
41             <if test="paramCondition.salesOrderCode != null and paramCondition.salesOrderCode != ''">
42                 and sales_order_code like CONCAT('%',#{paramCondition.salesOrderCode},'%')
43             </if>
44             <if test="paramCondition.customerNo != null and paramCondition.customerNo != ''">
45                 and customer_no like CONCAT('%',#{paramCondition.customerNo},'%')
46             </if>
47             <if test="paramCondition.cargoNo != null and paramCondition.cargoNo != ''">
48                 and cargo_no like CONCAT('%',#{paramCondition.cargoNo},'%')
49             </if>
50             <if test="paramCondition.productCode != null and paramCondition.productCode != ''">
51                 and product_code like CONCAT('%',#{paramCondition.productCode},'%')
52             </if>
53             <if test="paramCondition.productName != null and paramCondition.productName != ''">
54                 and product_name like CONCAT('%',#{paramCondition.productName},'%')
55             </if>
56             <if test="paramCondition.workshopCode != null and paramCondition.workshopCode != ''">
57                 and workshop_code like CONCAT('%',#{paramCondition.workshopCode},'%')
58             </if>
59             <if test="paramCondition.lineCode != null and paramCondition.lineCode != ''">
60                 and line_code like CONCAT('%',#{paramCondition.lineCode},'%')
61             </if>
62             <if test="paramCondition.state != null and paramCondition.state != ''">
63                 and state like CONCAT('%',#{paramCondition.state},'%')
64             </if>
65     </select>
66
67     <select id="customMapList" resultType="map" parameterType="cn.stylefeng.guns.modular.zsx.pm.salesOrder.model.params.SalesOrderParam">
68         select
69         <include refid="Base_Column_List"/>
70         from pm_sales_order where 1 = 1
71             <if test="paramCondition.salesOrderCode != null and paramCondition.salesOrderCode != ''">
72                 and sales_order_code like CONCAT('%',#{paramCondition.salesOrderCode},'%')
73             </if>
74             <if test="paramCondition.customerNo != null and paramCondition.customerNo != ''">
75                 and customer_no like CONCAT('%',#{paramCondition.customerNo},'%')
76             </if>
77             <if test="paramCondition.cargoNo != null and paramCondition.cargoNo != ''">
78                 and cargo_no like CONCAT('%',#{paramCondition.cargoNo},'%')
79             </if>
80             <if test="paramCondition.productCode != null and paramCondition.productCode != ''">
81                 and product_code like CONCAT('%',#{paramCondition.productCode},'%')
82             </if>
83             <if test="paramCondition.productName != null and paramCondition.productName != ''">
84                 and product_name like CONCAT('%',#{paramCondition.productName},'%')
85             </if>
86             <if test="paramCondition.workshopCode != null and paramCondition.workshopCode != ''">
87                 and workshop_code like CONCAT('%',#{paramCondition.workshopCode},'%')
88             </if>
89             <if test="paramCondition.lineCode != null and paramCondition.lineCode != ''">
90                 and line_code like CONCAT('%',#{paramCondition.lineCode},'%')
91             </if>
92             <if test="paramCondition.state != null and paramCondition.state != ''">
93                 and state like CONCAT('%',#{paramCondition.state},'%')
94             </if>
95     </select>
96
97     <select id="customPageList" resultType="cn.stylefeng.guns.modular.zsx.pm.salesOrder.model.result.SalesOrderResult" parameterType="cn.stylefeng.guns.modular.zsx.pm.salesOrder.model.params.SalesOrderParam">
98         select
99         <include refid="Base_Column_List"/>
100         from pm_sales_order where 1 = 1
101             <if test="paramCondition.id != null and paramCondition.id != ''">
102                 and id like CONCAT('%',#{paramCondition.id},'%')
103             </if>
104             <if test="paramCondition.salesOrderCode != null and paramCondition.salesOrderCode != ''">
105                 and sales_order_code like CONCAT('%',#{paramCondition.salesOrderCode},'%')
106             </if>
107             <if test="paramCondition.customerNo != null and paramCondition.customerNo != ''">
108                 and customer_no like CONCAT('%',#{paramCondition.customerNo},'%')
109             </if>
110             <if test="paramCondition.cargoNo != null and paramCondition.cargoNo != ''">
111                 and cargo_no like CONCAT('%',#{paramCondition.cargoNo},'%')
112             </if>
113             <if test="paramCondition.productCode != null and paramCondition.productCode != ''">
114                 and product_code like CONCAT('%',#{paramCondition.productCode},'%')
115             </if>
116             <if test="paramCondition.productName != null and paramCondition.productName != ''">
117                 and product_name like CONCAT('%',#{paramCondition.productName},'%')
118             </if>
119             <if test="paramCondition.workshopCode != null and paramCondition.workshopCode != ''">
120                 and workshop_code like CONCAT('%',#{paramCondition.workshopCode},'%')
121             </if>
122             <if test="paramCondition.lineCode != null and paramCondition.lineCode != ''">
123                 and line_code like CONCAT('%',#{paramCondition.lineCode},'%')
124             </if>
125             <if test="paramCondition.state != null and paramCondition.state != ''">
126                 and state like CONCAT('%',#{paramCondition.state},'%')
127             </if>
abb175 128         order by create_time desc
1ac2bc 129     </select>
130
131     <select id="customPageMapList" resultType="map" parameterType="cn.stylefeng.guns.modular.zsx.pm.salesOrder.model.params.SalesOrderParam">
132         select
133         <include refid="Base_Column_List"/>
134         from pm_sales_order where 1 = 1
135             <if test="paramCondition.salesOrderCode != null and paramCondition.salesOrderCode != ''">
136                 and sales_order_code like CONCAT('%',#{paramCondition.salesOrderCode},'%')
137             </if>
138             <if test="paramCondition.customerNo != null and paramCondition.customerNo != ''">
139                 and customer_no like CONCAT('%',#{paramCondition.customerNo},'%')
140             </if>
141             <if test="paramCondition.cargoNo != null and paramCondition.cargoNo != ''">
142                 and cargo_no like CONCAT('%',#{paramCondition.cargoNo},'%')
143             </if>
144             <if test="paramCondition.productCode != null and paramCondition.productCode != ''">
145                 and product_code like CONCAT('%',#{paramCondition.productCode},'%')
146             </if>
147             <if test="paramCondition.productName != null and paramCondition.productName != ''">
148                 and product_name like CONCAT('%',#{paramCondition.productName},'%')
149             </if>
150             <if test="paramCondition.workshopCode != null and paramCondition.workshopCode != ''">
151                 and workshop_code like CONCAT('%',#{paramCondition.workshopCode},'%')
152             </if>
153             <if test="paramCondition.lineCode != null and paramCondition.lineCode != ''">
154                 and line_code like CONCAT('%',#{paramCondition.lineCode},'%')
155             </if>
156             <if test="paramCondition.state != null and paramCondition.state != ''">
157                 and state like CONCAT('%',#{paramCondition.state},'%')
158             </if>
159     </select>
160
161     <select id="salesOrderNotinId" resultType="cn.stylefeng.guns.modular.zsx.pm.salesOrder.model.result.SalesOrderResult" parameterType="cn.stylefeng.guns.modular.zsx.pm.salesOrder.model.params.SalesOrderParam">
162         SELECT
163         <include refid="Base_Column_List"/>
164         FROM pm_sales_order WHERE sales_order_code = #{paramCondition.salesOrderCode} AND id not in (#{paramCondition.id})
165     </select>
166
167 </mapper>