mitao
2025-06-11 0184bf471382f9328df9bdd47acf451e4e2c5cb0
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
35
36
37
38
39
40
<?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.sinata.system.mapper.MwMicroEquipmentRecordItemMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.sinata.system.domain.MwMicroEquipmentRecordItem">
        <id column="ID" property="id" />
        <result column="EQUIPMENT_RECORD_ID" property="equipmentRecordId" />
        <result column="COLLECT_RECORD_ID" property="collectRecordId" />
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        ID, EQUIPMENT_RECORD_ID, COLLECT_RECORD_ID
    </sql>
    <select id="getRegulationReportList" resultType="com.sinata.system.domain.vo.MwCollectRecordVO"
            parameterType="com.sinata.system.domain.query.DisposalReportQuery">
        SELECT MCR.ID, MCR.WASTE_TYPE, MCR.WEIGHT, MMER.USE_TIME AS collectTime
        FROM MW_MICRO_EQUIPMENT_RECORD MMER INNER JOIN MW_MICRO_EQUIPMENT_RECORD_ITEM MMERI on MMER.ID =
        MMERI.EQUIPMENT_RECORD_ID
        INNER JOIN MW_COLLECT_RECORD MCR ON MCR.ID = MMERI.COLLECT_RECORD_ID
        INNER JOIN SYS_DEPARTMENT SD ON SD.ID = MCR.DEPARTMENT_ID
        <where>
            MMER.DEL_FLAG = 0
            <if test="treeCode != null and treeCode != ''">
                AND SD.TREE_CODE LIKE CONCAT(#{treeCode}, '%')
            </if>
            <if test="query.startTime != null and query.endTime != null">
                AND MMER.USE_TIME BETWEEN #{query.startTime} AND #{query.endTime}
            </if>
            <if test="query.wasteTypeCodeList != null and query.wasteTypeCodeList.size()>0">
                AND MCR.WASTE_TYPE IN
                <foreach collection="query.wasteTypeCodeList" item="wasteType" separator="," open="(" close=")">
                    #{wasteType}
                </foreach>
            </if>
        </where>
    </select>
 
</mapper>