admin
2024-01-08 22f70cc8b2ba603e82bba058db320dced48f9470
提交 | 用户 | 时间
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.em.equipmentStatus.mapper.EquipmentStatusMapper">
4
5     <!-- 通用查询映射结果 -->
6     <resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.em.equipmentStatus.entity.EquipmentStatus">
7         <id column="id" property="id" />
8         <result column="equipment_no" property="equipmentNo" />
9         <result column="equipment_name" property="equipmentName" />
10         <result column="workshop_code" property="workshopCode" />
11         <result column="production_line_code" property="productionLineCode" />
12         <result column="location_code" property="locationCode" />
13         <result column="status" property="status" />
14         <result column="spare_field_1" property="spareField1" />
15         <result column="spare_field_2" property="spareField2" />
16         <result column="remarks" property="remarks" />
17         <result column="update_time" property="updateTime" />
18     </resultMap>
19
20     <!-- 通用查询结果列 -->
21     <sql id="Base_Column_List">
22         id AS "id", equipment_no AS "equipmentNo", equipment_name AS "equipmentName", workshop_code AS "workshopCode", production_line_code AS "productionLineCode", location_code AS "locationCode", status AS "status", spare_field_1 AS "spareField1", spare_field_2 AS "spareField2", remarks AS "remarks", update_time AS "updateTime"
23     </sql>
24
25
26     <select id="customList" resultType="cn.stylefeng.guns.modular.em.equipmentStatus.model.result.EquipmentStatusResult" parameterType="cn.stylefeng.guns.modular.em.equipmentStatus.model.params.EquipmentStatusParam">
27         select
28         <include refid="Base_Column_List"/>
29         from em_equipment_status where 1 = 1
30         <if test="paramCondition.equipmentNo != null and paramCondition.equipmentNo != ''">
31             and equipment_no = #{paramCondition.equipmentNo}
32         </if>
33         <if test="paramCondition.equipmentName != null and paramCondition.equipmentName != ''">
34             and equipment_name like CONCAT('%',#{paramCondition.equipmentName},'%')
35         </if>
36         <if test="paramCondition.locationCode != null and paramCondition.locationCode != ''">
37             and location_code = #{paramCondition.locationCode}
38         </if>
39         order by id desc
40     </select>
41
42     <select id="customMapList" resultType="map" parameterType="cn.stylefeng.guns.modular.em.equipmentStatus.model.params.EquipmentStatusParam">
43         select
44         <include refid="Base_Column_List"/>
45         from em_equipment_status where 1 = 1
46     </select>
47
48     <select id="customPageList" resultType="cn.stylefeng.guns.modular.em.equipmentStatus.model.result.EquipmentStatusResult" parameterType="cn.stylefeng.guns.modular.em.equipmentStatus.model.params.EquipmentStatusParam">
49         select
50         <include refid="Base_Column_List"/>
51         from em_equipment_status where 1 = 1
52         <if test="paramCondition.equipmentNo != null and paramCondition.equipmentNo != ''">
53             and equipment_no like CONCAT('%',#{paramCondition.equipmentNo},'%')
54         </if>
55         <if test="paramCondition.equipmentName != null and paramCondition.equipmentName != ''">
56             and equipment_name like CONCAT('%',#{paramCondition.equipmentName},'%')
57         </if>
58         order by id desc
59     </select>
60
61     <select id="customPageMapList" resultType="map" parameterType="cn.stylefeng.guns.modular.em.equipmentStatus.model.params.EquipmentStatusParam">
62         select
63         <include refid="Base_Column_List"/>
64         from em_equipment_status where 1 = 1
65     </select>
66
67 </mapper>