懒羊羊
2023-09-19 a2805ec01e3a639713a418544dc65cb38a555fdd
提交 | 用户 | 时间
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.rm.recipeManage.mapper.RecipeManageMapper">
4
5     <!-- 通用查询映射结果 -->
6     <resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.rm.recipeManage.entity.RecipeManage">
7         <id column="id" property="id" />
8         <result column="production_line" property="productionLine" />
9         <result column="location_code" property="locationCode" />
10         <result column="product_code" property="productCode" />
11         <result column="operation_steps" property="operationSteps" />
12         <result column="tech_requirement" property="techRequirement" />
13         <result column="operation_type" property="operationType" />
14         <result column="step_sort" property="stepSort" />
15         <result column="param_code" property="paramCode" />
16         <result column="material_code" property="materialCode" />
17         <result column="picture" property="picture" />
18         <result column="remarks" property="remarks" />
19         <result column="spare_field_1" property="spareField1" />
20         <result column="spare_field_2" property="spareField2" />
21         <result column="spare_field_3" property="spareField3" />
22         <result column="spare_field_4" property="spareField4" />
23     </resultMap>
24
25     <!-- 通用查询结果列 -->
26     <sql id="Base_Column_List">
27         id AS "id", production_line AS "productionLine", location_code AS "locationCode", product_code AS "productCode", operation_steps AS "operationSteps", tech_requirement AS "techRequirement", operation_type AS "operationType", step_sort AS "stepSort", param_code AS "paramCode", material_code AS "materialCode", picture AS "picture", remarks AS "remarks", spare_field_1 AS "spareField1", spare_field_2 AS "spareField2", spare_field_3 AS "spareField3", spare_field_4 AS "spareField4"
28     </sql>
29
30
31     <select id="customList" resultType="cn.stylefeng.guns.modular.rm.recipeManage.model.result.RecipeManageResult" parameterType="cn.stylefeng.guns.modular.rm.recipeManage.model.params.RecipeManageParam">
32         select
33         <include refid="Base_Column_List"/>
34         from rm_recipe_manage where 1 = 1
35             <if test="paramCondition.productionLine != null and paramCondition.productionLine != ''">
36                 and production_line like CONCAT('%',#{paramCondition.productionLine},'%')
37             </if>
38             <if test="paramCondition.locationCode != null and paramCondition.locationCode != ''">
39                 and location_code like CONCAT('%',#{paramCondition.locationCode},'%')
40             </if>
41             <if test="paramCondition.productCode != null and paramCondition.productCode != ''">
42                 and product_code like CONCAT('%',#{paramCondition.productCode},'%')
43             </if>
44             <if test="paramCondition.paramCode != null and paramCondition.paramCode != ''">
45                 and param_code like CONCAT('%',#{paramCondition.paramCode},'%')
46             </if>
47             <if test="paramCondition.materialCode != null and paramCondition.materialCode != ''">
48                 and material_code like CONCAT('%',#{paramCondition.materialCode},'%')
49             </if>
50     </select>
51
52     <select id="customMapList" resultType="map" parameterType="cn.stylefeng.guns.modular.rm.recipeManage.model.params.RecipeManageParam">
53         select
54         <include refid="Base_Column_List"/>
55         from rm_recipe_manage where 1 = 1
56             <if test="paramCondition.productionLine != null and paramCondition.productionLine != ''">
57                 and production_line like CONCAT('%',#{paramCondition.productionLine},'%')
58             </if>
59             <if test="paramCondition.locationCode != null and paramCondition.locationCode != ''">
60                 and location_code like CONCAT('%',#{paramCondition.locationCode},'%')
61             </if>
62             <if test="paramCondition.productCode != null and paramCondition.productCode != ''">
63                 and product_code like CONCAT('%',#{paramCondition.productCode},'%')
64             </if>
65             <if test="paramCondition.paramCode != null and paramCondition.paramCode != ''">
66                 and param_code like CONCAT('%',#{paramCondition.paramCode},'%')
67             </if>
68             <if test="paramCondition.materialCode != null and paramCondition.materialCode != ''">
69                 and material_code like CONCAT('%',#{paramCondition.materialCode},'%')
70             </if>
71     </select>
72
73     <select id="customPageList" resultType="cn.stylefeng.guns.modular.rm.recipeManage.model.result.RecipeManageResult" parameterType="cn.stylefeng.guns.modular.rm.recipeManage.model.params.RecipeManageParam">
74         select
75         <include refid="Base_Column_List"/>
76         from rm_recipe_manage where 1 = 1
77             <if test="paramCondition.productionLine != null and paramCondition.productionLine != ''">
78                 and production_line like CONCAT('%',#{paramCondition.productionLine},'%')
79             </if>
80             <if test="paramCondition.locationCode != null and paramCondition.locationCode != ''">
81                 and location_code like CONCAT('%',#{paramCondition.locationCode},'%')
82             </if>
83             <if test="paramCondition.productCode != null and paramCondition.productCode != ''">
84                 and product_code like CONCAT('%',#{paramCondition.productCode},'%')
85             </if>
86             <if test="paramCondition.paramCode != null and paramCondition.paramCode != ''">
87                 and param_code like CONCAT('%',#{paramCondition.paramCode},'%')
88             </if>
89             <if test="paramCondition.materialCode != null and paramCondition.materialCode != ''">
90                 and material_code like CONCAT('%',#{paramCondition.materialCode},'%')
91             </if>
92             <if test="paramCondition.stepSortFlag != null and paramCondition.stepSortFlag != ''">
93                 and location_code = #{paramCondition.locationCode}
94                 and product_code = #{paramCondition.productCode}
95                 ORDER BY step_sort asc
96             </if>
97     </select>
98
99     <select id="customPageMapList" resultType="map" parameterType="cn.stylefeng.guns.modular.rm.recipeManage.model.params.RecipeManageParam">
100         select
101         <include refid="Base_Column_List"/>
102         from rm_recipe_manage where 1 = 1
103             <if test="paramCondition.productionLine != null and paramCondition.productionLine != ''">
104                 and production_line like CONCAT('%',#{paramCondition.productionLine},'%')
105             </if>
106             <if test="paramCondition.locationCode != null and paramCondition.locationCode != ''">
107                 and location_code like CONCAT('%',#{paramCondition.locationCode},'%')
108             </if>
109             <if test="paramCondition.productCode != null and paramCondition.productCode != ''">
110                 and product_code like CONCAT('%',#{paramCondition.productCode},'%')
111             </if>
112             <if test="paramCondition.paramCode != null and paramCondition.paramCode != ''">
113                 and param_code like CONCAT('%',#{paramCondition.paramCode},'%')
114             </if>
115             <if test="paramCondition.materialCode != null and paramCondition.materialCode != ''">
116                 and material_code like CONCAT('%',#{paramCondition.materialCode},'%')
117             </if>
118     </select>
119
120 </mapper>