long
2023-09-02 e379948bb83ebcc9ce0c467a7b970f74bc00e9a1
提交 | 用户 | 时间
71e81e 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.dq.materialTraceability.mapper.MaterialTraceabilityMapper">
4
5     <!-- 通用查询映射结果 -->
6     <resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.dq.materialTraceability.entity.MaterialTraceability">
7         <id column="id" property="id" />
8         <result column="product_no" property="productNo" />
9         <result column="housing_bar_code" property="housingBarCode" />
10         <result column="work_order_no" property="workOrderNo" />
11         <result column="product_code" property="productCode" />
12         <result column="product_name" property="productName" />
13         <result column="line_code" property="lineCode" />
14         <result column="line_name" property="lineName" />
15         <result column="location_code" property="locationCode" />
16         <result column="location_name" property="locationName" />
17         <result column="material_code" property="materialCode" />
18         <result column="material_name" property="materialName" />
19         <result column="material_batch_no" property="materialBatchNo" />
20         <result column="material_serial_no" property="materialSerialNo" />
21         <result column="assembly_qty" property="assemblyQty" />
22         <result column="assembly_user" property="assemblyUser" />
23         <result column="assembly_time" property="assemblyTime" />
24         <result column="spare_field_1" property="spareField1" />
25         <result column="spare_field_2" property="spareField2" />
26         <result column="spare_field_3" property="spareField3" />
27         <result column="spare_field_4" property="spareField4" />
28         <result column="remarks" property="remarks" />
29     </resultMap>
30
31     <!-- 通用查询结果列 -->
32     <sql id="Base_Column_List">
33         id AS "id", product_no AS "productNo", housing_bar_code AS "housingBarCode", work_order_no AS "workOrderNo", product_code AS "productCode", product_name AS "productName", line_code AS "lineCode", line_name AS "lineName", location_code AS "locationCode", location_name AS "locationName", material_code AS "materialCode", material_name AS "materialName", material_batch_no AS "materialBatchNo", material_serial_no AS "materialSerialNo", assembly_qty AS "assemblyQty", assembly_user AS "assemblyUser", assembly_time AS "assemblyTime", spare_field_1 AS "spareField1", spare_field_2 AS "spareField2", spare_field_3 AS "spareField3", spare_field_4 AS "spareField4", remarks AS "remarks"
34     </sql>
35
36
37     <select id="customList" resultType="cn.stylefeng.guns.modular.dq.materialTraceability.model.result.MaterialTraceabilityResult" parameterType="cn.stylefeng.guns.modular.dq.materialTraceability.model.params.MaterialTraceabilityParam">
38         select
39         <include refid="Base_Column_List"/>
40         from dq_material_traceability where 1 = 1
41         <if test="paramCondition.productNo != null and paramCondition.productNo != ''">
42             and product_no like CONCAT('%',#{paramCondition.productNo},'%')
43         </if>
44         <if test="paramCondition.materialCode != null and paramCondition.materialCode != ''">
45             and material_code like CONCAT('%',#{paramCondition.materialCode},'%')
46         </if>
47         <if test="paramCondition.workOrderNo != null and paramCondition.workOrderNo != ''">
48             and work_order_no like CONCAT('%',#{paramCondition.workOrderNo},'%')
49         </if>
50         <if test="paramCondition.materialBatchNo != null and paramCondition.materialBatchNo != ''">
51             and material_batch_no like CONCAT('%',#{paramCondition.materialBatchNo},'%')
52         </if>
53         <if test="paramCondition.materialSerialNo != null and paramCondition.materialSerialNo != ''">
54             and material_serial_no like CONCAT('%',#{paramCondition.materialSerialNo},'%')
55         </if>
56         <if test="paramCondition.startTime != null and paramCondition.startTime != ''">
57             and assembly_time &gt;= #{paramCondition.startTime}
58         </if>
59         <if test="paramCondition.endTime != null and paramCondition.endTime != ''">
60             and assembly_time &lt;= #{paramCondition.endTime}
61         </if>
62     </select>
63
64     <select id="customMapList" resultType="map" parameterType="cn.stylefeng.guns.modular.dq.materialTraceability.model.params.MaterialTraceabilityParam">
65         select
66         <include refid="Base_Column_List"/>
67         from dq_material_traceability where 1 = 1
68     </select>
69
70     <select id="customPageList" resultType="cn.stylefeng.guns.modular.dq.materialTraceability.model.result.MaterialTraceabilityResult" parameterType="cn.stylefeng.guns.modular.dq.materialTraceability.model.params.MaterialTraceabilityParam">
71         select
72         <include refid="Base_Column_List"/>
73         from dq_material_traceability where 1 = 1
74         <if test="paramCondition.productNo != null and paramCondition.productNo != ''">
75             and product_no like CONCAT('%',#{paramCondition.productNo},'%')
76         </if>
77         <if test="paramCondition.workOrderNo != null and paramCondition.workOrderNo != ''">
78             and work_order_no like CONCAT('%',#{paramCondition.workOrderNo},'%')
79         </if>
80         <if test="paramCondition.materialBatchNo != null and paramCondition.materialBatchNo != ''">
81             and material_batch_no like CONCAT('%',#{paramCondition.materialBatchNo},'%')
82         </if>
83         <if test="paramCondition.materialSerialNo != null and paramCondition.materialSerialNo != ''">
84             and material_serial_no like CONCAT('%',#{paramCondition.materialSerialNo},'%')
85         </if>
86         <if test="paramCondition.startTime != null and paramCondition.startTime != ''">
87             and assembly_time &gt;= #{paramCondition.startTime}
88         </if>
89         <if test="paramCondition.endTime != null and paramCondition.endTime != ''">
90             and assembly_time &lt;= #{paramCondition.endTime}
91         </if>
92     </select>
93
94     <select id="customPageMapList" resultType="map" parameterType="cn.stylefeng.guns.modular.dq.materialTraceability.model.params.MaterialTraceabilityParam">
95         select
96         <include refid="Base_Column_List"/>
97         from dq_material_traceability where 1 = 1
98     </select>
99     <update id="updateSFC">
100         update dq_material_traceability set product_no = #{sfcCode} where product_no = #{childSfcCode}
101     </update>
102
103 </mapper>