<?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>
|