懒羊羊
2023-10-17 5d91e0a52879bf16511817b3cd20496f07717ab1
提交 | 用户 | 时间
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.bs.material.mapper.MaterialInfoMapper">
4
5     <!-- 通用查询映射结果 -->
6     <resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.zsx.bs.material.entity.MaterialInfo">
7         <id column="id" property="id" />
8         <result column="material_code" property="materialCode" />
9         <result column="material_name" property="materialName" />
10         <result column="material_view" property="materialView" />
11         <result column="type_z" property="typeZ" />
12         <result column="type_l" property="typeL" />
13         <result column="unit" property="unit" />
14         <result column="matter_version" property="matterVersion" />
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         <result column="erp_spec" property="erpSpec" />
21     </resultMap>
22
23     <!-- 通用查询结果列 -->
24     <sql id="Base_Column_List">
25         id AS "id", material_code AS "materialCode", material_name AS "materialName", material_view AS "materialView", type_z AS "typeZ", type_l AS "typeL", unit AS "unit", matter_version AS "matterVersion", remarks AS "remarks", create_user AS "createUser", create_time AS "createTime", update_user AS "updateUser", update_time AS "updateTime", erp_spec AS "erpSpec"
26     </sql>
27
28
29     <select id="customList" resultType="cn.stylefeng.guns.modular.zsx.bs.material.model.result.MaterialInfoResult" parameterType="cn.stylefeng.guns.modular.zsx.bs.material.model.params.MaterialInfoParam">
30         select
31         <include refid="Base_Column_List"/>
32         from bs_material_info where 1 = 1
33             <if test="paramCondition.materialCode != null and paramCondition.materialCode != ''">
34                 and material_code like CONCAT('%',#{paramCondition.materialCode},'%')
35             </if>
36             <if test="paramCondition.materialName != null and paramCondition.materialName != ''">
37                 and material_name like CONCAT('%',#{paramCondition.materialName},'%')
38             </if>
39             <if test="paramCondition.materialView != null and paramCondition.materialView != ''">
40                 and material_view like CONCAT('%',#{paramCondition.materialView},'%')
41             </if>
42             <if test="paramCondition.typeL != null and paramCondition.typeL != ''">
43                 and type_l like CONCAT('%',#{paramCondition.typeL},'%')
44             </if>
92cffc 45             <if test="paramCondition.typeZ != null and paramCondition.typeZ != ''">
46                 and type_Z like CONCAT('%',#{paramCondition.typeZ},'%')
47             </if>
1ac2bc 48     </select>
49
50     <select id="customMapList" resultType="map" parameterType="cn.stylefeng.guns.modular.zsx.bs.material.model.params.MaterialInfoParam">
51         select
52         <include refid="Base_Column_List"/>
53         from bs_material_info where 1 = 1
54             <if test="paramCondition.materialCode != null and paramCondition.materialCode != ''">
55                 and material_code like CONCAT('%',#{paramCondition.materialCode},'%')
56             </if>
57             <if test="paramCondition.materialName != null and paramCondition.materialName != ''">
58                 and material_name like CONCAT('%',#{paramCondition.materialName},'%')
59             </if>
60             <if test="paramCondition.materialView != null and paramCondition.materialView != ''">
61                 and material_view like CONCAT('%',#{paramCondition.materialView},'%')
62             </if>
63             <if test="paramCondition.typeL != null and paramCondition.typeL != ''">
64                 and type_l like CONCAT('%',#{paramCondition.typeL},'%')
92cffc 65             </if>
66             <if test="paramCondition.typeZ != null and paramCondition.typeZ != ''">
67                 and type_Z like CONCAT('%',#{paramCondition.typeZ},'%')
1ac2bc 68             </if>
69     </select>
70
71     <select id="customPageList" resultType="cn.stylefeng.guns.modular.zsx.bs.material.model.result.MaterialInfoResult" parameterType="cn.stylefeng.guns.modular.zsx.bs.material.model.params.MaterialInfoParam">
72         select
73         <include refid="Base_Column_List"/>
74         from bs_material_info where 1 = 1
75             <if test="paramCondition.materialCode != null and paramCondition.materialCode != ''">
76                 and material_code like CONCAT('%',#{paramCondition.materialCode},'%')
77             </if>
78             <if test="paramCondition.materialName != null and paramCondition.materialName != ''">
79                 and material_name like CONCAT('%',#{paramCondition.materialName},'%')
80             </if>
81             <if test="paramCondition.materialView != null and paramCondition.materialView != ''">
82                 and material_view like CONCAT('%',#{paramCondition.materialView},'%')
83             </if>
84             <if test="paramCondition.typeL != null and paramCondition.typeL != ''">
85                 and type_l like CONCAT('%',#{paramCondition.typeL},'%')
86             </if>
92cffc 87             <if test="paramCondition.typeZ != null and paramCondition.typeZ != ''">
88                 and type_Z like CONCAT('%',#{paramCondition.typeZ},'%')
89             </if>
1ac2bc 90     </select>
91
92     <select id="customPageMapList" resultType="map" parameterType="cn.stylefeng.guns.modular.zsx.bs.material.model.params.MaterialInfoParam">
93         select
94         <include refid="Base_Column_List"/>
95         from bs_material_info where 1 = 1
96             <if test="paramCondition.materialCode != null and paramCondition.materialCode != ''">
97                 and material_code like CONCAT('%',#{paramCondition.materialCode},'%')
98             </if>
99             <if test="paramCondition.materialName != null and paramCondition.materialName != ''">
100                 and material_name like CONCAT('%',#{paramCondition.materialName},'%')
101             </if>
102             <if test="paramCondition.materialView != null and paramCondition.materialView != ''">
103                 and material_view like CONCAT('%',#{paramCondition.materialView},'%')
104             </if>
105             <if test="paramCondition.typeL != null and paramCondition.typeL != ''">
106                 and type_l like CONCAT('%',#{paramCondition.typeL},'%')
107             </if>
92cffc 108             <if test="paramCondition.typeZ != null and paramCondition.typeZ != ''">
109                 and type_Z like CONCAT('%',#{paramCondition.typeZ},'%')
110             </if>
1ac2bc 111     </select>
112
113 </mapper>