<?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="cn.flightfeather.supervision.domain.ds1.mapper.DataProductMapper">
|
<!-- 行政区划条件 -->
|
<sql id="Where_Area">
|
<if test="provinceCode != null">
|
AND ${pCode} = #{provinceCode}
|
</if>
|
<if test="cityCode != null">
|
AND ${cCode} = #{cityCode}
|
</if>
|
<if test="districtCode != null">
|
AND ${dCode} = #{districtCode}
|
</if>
|
<if test="townCode != null">
|
AND ${tCode} = #{townCode}
|
</if>
|
</sql>
|
<!-- 时间条件 -->
|
<sql id="Where_Time">
|
<if test="startTime != null">
|
AND ${sTime} >= #{startTime}
|
</if>
|
<if test="endTime != null">
|
AND ${eTime} <= #{endTime}
|
</if>
|
</sql>
|
<!-- 场景信息条件 -->
|
<sql id="Where_Scene">
|
<if test="sceneId != null">
|
AND ${sId} = #{sceneId}
|
</if>
|
<if test="sceneTypeId != null">
|
AND ${typeId} = #{sceneTypeId}
|
</if>
|
</sql>
|
|
<!-- 查询问题整改清单-->
|
<select id="problemChangeList" resultType="cn.flightfeather.supervision.model.dataproduct.PPListProblemChange">
|
SELECT
|
b.S_Index as `index`,
|
a.PL_SenseName as sceneName,
|
b.S_Type as sceneType,
|
b.S_ProvinceName as provinceName,
|
b.S_CityName as cityName,
|
b.S_DistrictName as districtName,
|
b.S_TownName as townName,
|
c.ST_PlanStartTime as inspectionTime,
|
d.PT_TypeName as problemType,
|
d.PT_Name as problemName,
|
a.PL_Location as location,
|
a.PL_Time as problemTime,
|
a.PL_IsChanged as hasChanged,
|
a.PL_IsChanged as changeSum,
|
a.PL_ChangedTime as changedTime
|
FROM
|
im_t_problemlist AS a
|
LEFT JOIN sm_t_scense AS b ON a.S_GUID = b.S_GUID
|
LEFT JOIN tm_t_subtask as c on a.ST_GUID = c.ST_GUID
|
LEFT JOIN sm_t_problemtype as d on a.PT_GUID = d.PT_GUID
|
<where>
|
<include refid="Where_Area">
|
<property name="pCode" value="b.S_ProvinceCode"/>
|
<property name="cCode" value="b.S_CityCode"/>
|
<property name="dCode" value="b.S_DistrictCode"/>
|
<property name="tCode" value="b.S_TownCode"/>
|
</include>
|
<include refid="Where_Time">
|
<property name="sTime" value="a.PL_Time"/>
|
<property name="eTime" value="a.PL_Time"/>
|
</include>
|
<include refid="Where_Scene">
|
<property name="sId" value="b.S_GUID"/>
|
<property name="typeId" value="b.S_TypeID"/>
|
</include>
|
</where>
|
ORDER BY a.PL_SenseName, c.ST_PlanStartTime, d.PT_TypeName, a.PL_Time ASC
|
</select>
|
</mapper>
|