懒羊羊
2023-09-19 3d2401cf8ea9ae3d830c0568e7751e2e8cc8db22
提交 | 用户 | 时间
3d2401 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.bs.location.mapper.LocationInfoMapper">
4
5     <!-- 通用查询映射结果 -->
6     <resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.zsx.bs.location.entity.LocationInfo">
7         <id column="id" property="id" />
8         <result column="location_code" property="locationCode" />
9         <result column="location_name" property="locationName" />
10         <result column="location_type" property="locationType" />
11         <result column="workshop_code" property="workshopCode" />
12         <result column="production_line_code" property="productionLineCode" />
13         <result column="spare_field_1" property="spareField1" />
14         <result column="spare_field_2" property="spareField2" />
15         <result column="remarks" property="remarks" />
16         <result column="create_user" property="createUser" />
17         <result column="create_time" property="createTime" />
18         <result column="update_user" property="updateUser" />
19         <result column="update_time" property="updateTime" />
20     </resultMap>
21
22     <!-- 通用查询结果列 -->
23     <sql id="Base_Column_List">
24         id AS "id", location_code AS "locationCode", location_name AS "locationName", location_type AS "locationType", workshop_code AS "workshopCode", production_line_code AS "productionLineCode", spare_field_1 AS "spareField1", spare_field_2 AS "spareField2", remarks AS "remarks", create_user AS "createUser", create_time AS "createTime", update_user AS "updateUser", update_time AS "updateTime"
25     </sql>
26
27
28     <select id="customList" resultType="cn.stylefeng.guns.modular.zsx.bs.location.model.result.LocationInfoResult" parameterType="cn.stylefeng.guns.modular.zsx.bs.location.model.params.LocationInfoParam">
29         select
30         <include refid="Base_Column_List"/>
31         from bs_location_info where 1 = 1
32             <if test="paramCondition.locationCode != null and paramCondition.locationCode != ''">
33                 and location_code like CONCAT('%',#{paramCondition.locationCode},'%')
34             </if>
35             <if test="paramCondition.locationName != null and paramCondition.locationName != ''">
36                 and location_name like CONCAT('%',#{paramCondition.locationName},'%')
37             </if>
38             <if test="paramCondition.locationType != null and paramCondition.locationType != ''">
39                 and location_type like CONCAT('%',#{paramCondition.locationType},'%')
40             </if>
41             <if test="paramCondition.workshopCode != null and paramCondition.workshopCode != ''">
42                 and workshop_code like CONCAT('%',#{paramCondition.workshopCode},'%')
43             </if>
44             <if test="paramCondition.productionLineCode != null and paramCondition.productionLineCode != ''">
45                 and production_line_code like CONCAT('%',#{paramCondition.productionLineCode},'%')
46             </if>
47     </select>
48
49     <select id="customMapList" resultType="map" parameterType="cn.stylefeng.guns.modular.zsx.bs.location.model.params.LocationInfoParam">
50         select
51         <include refid="Base_Column_List"/>
52         from bs_location_info where 1 = 1
53             <if test="paramCondition.locationCode != null and paramCondition.locationCode != ''">
54                 and location_code like CONCAT('%',#{paramCondition.locationCode},'%')
55             </if>
56             <if test="paramCondition.locationName != null and paramCondition.locationName != ''">
57                 and location_name like CONCAT('%',#{paramCondition.locationName},'%')
58             </if>
59             <if test="paramCondition.locationType != null and paramCondition.locationType != ''">
60                 and location_type like CONCAT('%',#{paramCondition.locationType},'%')
61             </if>
62             <if test="paramCondition.workshopCode != null and paramCondition.workshopCode != ''">
63                 and workshop_code like CONCAT('%',#{paramCondition.workshopCode},'%')
64             </if>
65             <if test="paramCondition.productionLineCode != null and paramCondition.productionLineCode != ''">
66                 and production_line_code like CONCAT('%',#{paramCondition.productionLineCode},'%')
67             </if>
68     </select>
69
70     <select id="customPageList" resultType="cn.stylefeng.guns.modular.zsx.bs.location.model.result.LocationInfoResult" parameterType="cn.stylefeng.guns.modular.zsx.bs.location.model.params.LocationInfoParam">
71         select
72         <include refid="Base_Column_List"/>
73         from bs_location_info where 1 = 1
74             <if test="paramCondition.locationCode != null and paramCondition.locationCode != ''">
75                 and location_code like CONCAT('%',#{paramCondition.locationCode},'%')
76             </if>
77             <if test="paramCondition.locationName != null and paramCondition.locationName != ''">
78                 and location_name like CONCAT('%',#{paramCondition.locationName},'%')
79             </if>
80             <if test="paramCondition.locationType != null and paramCondition.locationType != ''">
81                 and location_type like CONCAT('%',#{paramCondition.locationType},'%')
82             </if>
83             <if test="paramCondition.workshopCode != null and paramCondition.workshopCode != ''">
84                 and workshop_code like CONCAT('%',#{paramCondition.workshopCode},'%')
85             </if>
86             <if test="paramCondition.productionLineCode != null and paramCondition.productionLineCode != ''">
87                 and production_line_code like CONCAT('%',#{paramCondition.productionLineCode},'%')
88             </if>
89     </select>
90
91     <select id="customPageMapList" resultType="map" parameterType="cn.stylefeng.guns.modular.zsx.bs.location.model.params.LocationInfoParam">
92         select
93         <include refid="Base_Column_List"/>
94         from bs_location_info where 1 = 1
95             <if test="paramCondition.locationCode != null and paramCondition.locationCode != ''">
96                 and location_code like CONCAT('%',#{paramCondition.locationCode},'%')
97             </if>
98             <if test="paramCondition.locationName != null and paramCondition.locationName != ''">
99                 and location_name like CONCAT('%',#{paramCondition.locationName},'%')
100             </if>
101             <if test="paramCondition.locationType != null and paramCondition.locationType != ''">
102                 and location_type like CONCAT('%',#{paramCondition.locationType},'%')
103             </if>
104             <if test="paramCondition.workshopCode != null and paramCondition.workshopCode != ''">
105                 and workshop_code like CONCAT('%',#{paramCondition.workshopCode},'%')
106             </if>
107             <if test="paramCondition.productionLineCode != null and paramCondition.productionLineCode != ''">
108                 and production_line_code like CONCAT('%',#{paramCondition.productionLineCode},'%')
109             </if>
110     </select>
111
112 </mapper>