yangys
2024-11-02 f69073b835f1a0c66590130e1830edcdd75ebb8a
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
<?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.qianwen.smartman.modules.tpm.mapper.CheckRecordMapper">
 
    <select id="getTodayPage" resultType="com.qianwen.smartman.modules.tpm.vo.CheckRecordTodayVO">
        select
        cr.id,
        cr.check_code as checkCode,
        wm.machine_code as machineCode,
        wm.machine_name as machineName,
        dt.name as typeName,
        cp.name as checkProjectName,
        cr.check_time as checkTime
        from
        blade_check_record cr
        left join blade_check_project cp on cr.check_project_id = cp.id and cr.is_deleted =0
        left join blade_device_type dt on cr.device_type_id = dt.id and dt.is_deleted =0
        LEFT JOIN blade_machine wm on cr.device_id = wm.id and wm.is_deleted = 0
        where cr.is_deleted =0 and TO_CHAR(cr.create_time, 'yyyy-mm-dd') = TO_CHAR(SYSDATE, 'yyyy-mm-dd')
        <if test="searchDTO.machineCode != null and searchDTO.machineCode !=''">
            and wm.machine_code like concat(#{searchDTO.machineCode},'%')
        </if>
        <if test="searchDTO.machineName != null and searchDTO.machineName !=''">
            and wm.machine_name like concat(#{searchDTO.machineName},'%')
        </if>
        <if test="searchDTO.checkProjectName != null and searchDTO.checkProjectName !=''">
            and cp.name like concat(#{searchDTO.checkProjectName},'%')
        </if>
    </select>
 
</mapper>