zss
2025-01-13 8d85246f061e3da623c7b9eb4e323ee724b4de0b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yuanchu.mom.mapper.DeviceMaintenancePlanMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.yuanchu.mom.pojo.DeviceMaintenancePlan">
        <id column="maintenance_plan_id" property="maintenancePlanId" />
        <result column="create_user" property="createUser" />
        <result column="create_id" property="createId" />
        <result column="create_date" property="createDate" />
        <result column="audit_id" property="auditId" />
        <result column="audit" property="audit" />
        <result column="audit_date" property="auditDate" />
    </resultMap>
 
    <!-- 根据设备id查询设备的保养计划 -->
    <select id="selectDeviceParameterPage" resultType="com.yuanchu.mom.pojo.DeviceMaintenancePlan">
        select
            *
        from device_maintenance_plan
        <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
            ${ew.customSqlSegment}
        </if>
    </select>
    <select id="selectMaintenancePlanById" resultType="com.yuanchu.mom.dto.DeviceMaintenancePlanDto">
        select
            dmp.*,
            date_format(dmp.date_preparation, '%Y-%m-%d') as datePreparationStr,
            date_format(dmp.audit_date, '%Y-%m-%d') as auditDateStr
        from device_maintenance_plan dmp
        where dmp.maintenance_plan_id = #{maintenancePlanId}
    </select>
 
</mapper>