btxtgxq-system-city/src/main/resources/mybatis/mapper/datarelease/datarelease-mapper.xml

109 lines
3.7 KiB
XML
Raw Normal View History

<?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.cm.systemcity.dao.datarelease.IDataReleaseDao">
<!-- 查询上报案件 -->
<select id="listReportCase" parameterType="map" resultType="map">
SELECT
*
FROM
city_report_case
WHERE
is_delete = '0'
<if test="caseStatus != null and caseStatus != ''">
AND case_status = #{caseStatus}
</if>
<if test="dataCatalog != null and dataCatalog == 'dept'">
AND case_flow_type = '1'
</if>
<if test="dataCatalog != null and dataCatalog == 'street'">
AND case_flow_type = '2'
AND case_reporter NOT LIKE CONCAT('%',CONCAT('微信', '%'))
</if>
<if test="dataCatalog != null and dataCatalog == 'person'">
AND case_flow_type = '2'
AND case_reporter LIKE CONCAT('%',CONCAT('微信', '%'))
</if>
<if test="gmtCreateLike != null and gmtCreateLike != ''">
AND gmt_create LIKE CONCAT('%',CONCAT(#{gmtCreateLike}, '%'))
</if>
<if test="gmtModified != null and gmtModified != ''">
AND gmt_modified LIKE CONCAT('%',CONCAT(#{gmtModified}, '%'))
</if>
<if test="areaId != null and areaId !=''">
AND area_id = #{areaId}
</if>
<if test="caseStatusCompareUp != null and caseStatusCompareUp !=''">
AND case_status <![CDATA[>=]]> #{caseStatusCompareUp}
</if>
<if test="modifiedStr != null and modifiedStr !=''">
AND gmt_modified <![CDATA[>=]]> #{modifiedStr}
</if>
<if test="modifiedEnd != null and modifiedEnd !=''">
AND gmt_modified <![CDATA[<=]]> #{modifiedEnd}
</if>
</select>
<select id="listSpecialReportCase" parameterType="map" resultType="map">
SELECT
*
FROM
city_special_report_case
WHERE
is_delete = '0'
<if test="caseStatus != null and caseStatus != ''">
AND case_status = #{caseStatus}
</if>
<if test="gmtModified != null and gmtModified != ''">
AND gmt_modified LIKE CONCAT('%',CONCAT(#{gmtModified}, '%'))
</if>
<if test="areaId != null and areaId !=''">
AND area_id = #{areaId}
</if>
</select>
<select id="getCaseTypeTop10" parameterType="map" resultType="map">
SELECT
t1.case_type_id caseTypeId,
t2.dict_name dictName,
COUNT(t1.case_type_id) caseTypeCount
FROM
city_report_case t1
LEFT JOIN city_dict t2 ON t1.case_type_id = t2.dict_id
WHERE
t1.is_delete = '0'
GROUP BY
t1.case_type_id,
t2.dict_name
ORDER BY
caseTypeCount DESC
LIMIT 0,10
</select>
<select id="listReportCaseLog" parameterType="map" resultType="map">
SELECT
t1.option_type optionType,
t1.user_name userName,
t1.gmt_create gmtCreate,
t2.case_content caseContent
FROM
city_report_case_log t1
LEFT JOIN city_report_case t2 ON t1.case_id = t2.report_case_id
ORDER BY
t1.gmt_create DESC
LIMIT 0,10
</select>
<select id="listUserDynamicPosition" parameterType="map" resultType="map">
SELECT
creator,
user_name
FROM
city_user_location
WHERE
gmt_create <![CDATA[ >= ]]> #{timeStr}
AND gmt_create <![CDATA[ <= ]]> #{timeEnd}
GROUP BY
creator,user_name
</select>
</mapper>