<?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.panzhihua.service_community.dao.ComActAcidRecordDao">
|
|
<resultMap type="com.panzhihua.service_community.entity.ComActAcidRecord" id="ComActAcidRecordBaseResultMap">
|
<result property="id" column="id"/>
|
<result property="name" column="name"/>
|
<result property="idCard" column="id_card"/>
|
<result property="phone" column="phone"/>
|
<result property="departureCity" column="departure_city"/>
|
<result property="departureAddress" column="departure_address"/>
|
<result property="departureDate" column="departure_date"/>
|
<result property="touristCity" column="tourist_city"/>
|
<result property="localCity" column="local_city"/>
|
<result property="localAddress" column="local_address"/>
|
<result property="arriveDate" column="arrive_date"/>
|
<result property="colorMark" column="color_mark"/>
|
<result property="travelCard" column="travel_card"/>
|
<result property="dangerArea" column="danger_area"/>
|
<result property="outsideCity" column="outside_city"/>
|
<result property="vaccination" column="vaccination"/>
|
<result property="acidTest" column="acid_test"/>
|
</resultMap>
|
<update id="batchCheck">
|
UPDATE com_act_acid_record SET check_status = 1
|
<if test="batchCheckAcidRecordDTO.remark != null and batchCheckAcidRecordDTO.remark != """>
|
,remark = #{batchCheckAcidRecordDTO.remark}
|
</if>
|
WHERE id IN
|
<foreach collection="batchCheckAcidRecordDTO.ids" item="id" index="index" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</update>
|
|
<select id="pageList" resultType="com.panzhihua.common.model.vos.community.acid.ComActAcidRecordVO">
|
select * from com_act_acid_record
|
<where>
|
is_del=0
|
<if test="commonPage.userId !=null">
|
and user_id = #{commonPage.userId}
|
</if>
|
<if test="commonPage.checkStatus !=null and commonPage.checkStatus !=''">
|
and check_status = #{commonPage.checkStatus}
|
</if>
|
<if test="commonPage.keyword !=null and commonPage.keyword!=''">
|
and (name like concat('%',#{commonPage.keyword},'%') or phone like concat('%',#{commonPage.keyword},'%')
|
or id_card like concat('%',#{commonPage.keyword},'%'))
|
</if>
|
<if test="commonPage.startTime !=null and commonPage.startTime !=''">
|
and create_time between #{commonPage.startTime} and #{commonPage.stopTime}
|
</if>
|
<if test="commonPage.isAddress !=null">
|
<if test="commonPage.isAddress == 0">
|
and (local_city is null OR LENGTH(TRIM(local_city)) = 0)
|
</if>
|
<if test="commonPage.isAddress == 1">
|
and local_city is not null AND LENGTH(TRIM(local_city)) > 0
|
</if>
|
</if>
|
<if test="commonPage.departureCity !=null and commonPage.departureCity !=''">
|
and departure_city like concat('%',#{commonPage.departureCity},'%')
|
</if>
|
<if test="commonPage.touristCity !=null and commonPage.touristCity !=''">
|
and tourist_city like concat('%',#{commonPage.touristCity},'%')
|
</if>
|
<if test="commonPage.dangerArea !=null and commonPage.dangerArea !=''">
|
and danger_area = #{commonPage.dangerArea}
|
</if>
|
<if test="commonPage.localCity !=null and commonPage.localCity !='' and commonPage.localCity !='panzhihua'">
|
and local_city like concat('%',#{commonPage.localCity},'%')
|
</if>
|
<if test="commonPage.colorMark !=null and commonPage.colorMark !=''">
|
and color_mark like concat('%',#{commonPage.colorMark},'%')
|
</if>
|
<if test="commonPage.travelCard !=null and commonPage.travelCard !=''">
|
and travel_card like concat('%',#{commonPage.travelCard},'%')
|
</if>
|
<if test="commonPage.type == 1">
|
and local_city like concat('%','社区')
|
</if>
|
<if test="commonPage.type == 2">
|
and local_city like concat('%','村')
|
</if>
|
</where>
|
order by check_status asc,create_time desc
|
</select>
|
|
<select id="export" resultType="com.panzhihua.common.model.vos.community.acid.ComActAcidRecordExcelReturn">
|
select t.*,t1.status from com_act_acid_record t left join com_act_acid_danger_member t1 on t.id = t1.record_id
|
<where>
|
t.is_del=0 and t.name is not null and t.id_card is not null and t.phone is not null
|
<if test="commonPage.userId !=null">
|
and t.user_id = #{commonPage.userId}
|
</if>
|
<if test="commonPage.checkStatus !=null and commonPage.checkStatus !=''">
|
and check_status = #{commonPage.checkStatus}
|
</if>
|
<if test="commonPage.keyword !=null and commonPage.keyword!=''">
|
and (t.name like concat('%',#{commonPage.keyword},'%') or t.phone like
|
concat('%',#{commonPage.keyword},'%') or t.id_card like concat('%',#{commonPage.keyword},'%'))
|
</if>
|
<if test="commonPage.startTime !=null and commonPage.startTime !=''">
|
and t.create_time between #{commonPage.startTime} and #{commonPage.stopTime}
|
</if>
|
<if test="commonPage.isAddress !=null">
|
<if test="commonPage.isAddress == 0">
|
and (local_city is null OR LENGTH(TRIM(local_city)) = 0)
|
</if>
|
<if test="commonPage.isAddress == 1">
|
and local_city is not null AND LENGTH(TRIM(local_city)) > 0
|
</if>
|
</if>
|
<if test="commonPage.departureCity !=null and commonPage.departureCity !=''">
|
and departure_city like concat('%',#{commonPage.departureCity},'%')
|
</if>
|
<if test="commonPage.touristCity !=null and commonPage.touristCity !=''">
|
and tourist_city like concat('%',#{commonPage.touristCity},'%')
|
</if>
|
<if test="commonPage.dangerArea !=null and commonPage.dangerArea !=''">
|
and danger_area = #{commonPage.dangerArea}
|
</if>
|
<if test="commonPage.localCity !=null and commonPage.localCity !='' and commonPage.localCity !='panzhihua'">
|
and local_city like concat('%',#{commonPage.localCity},'%')
|
</if>
|
<if test="commonPage.colorMark !=null and commonPage.colorMark !=''">
|
and color_mark like concat('%',#{commonPage.colorMark},'%')
|
</if>
|
<if test="commonPage.travelCard !=null and commonPage.travelCard !=''">
|
and travel_card like concat('%',#{commonPage.travelCard},'%')
|
</if>
|
</where>
|
order by t.create_time desc
|
</select>
|
|
<select id="selectByIds" resultType="com.panzhihua.common.model.vos.community.acid.ComActAcidRecordExcelReturn">
|
select t.*,t1.status from com_act_acid_record t left join com_act_acid_danger_member t1 on t.id = t1.record_id
|
<where>
|
t.is_del=0 and t.name is not null and t.id_card is not null and t.phone is not null
|
<if test="ids !=null and ids !=''">
|
and t.id in (${ids})
|
</if>
|
</where>
|
order by t.create_time desc
|
</select>
|
|
<select id="exportNew" resultType="com.panzhihua.common.model.vos.community.acid.ComActAcidRecordExcelReturn">
|
select t.*,t1.status from com_act_acid_record t left join com_act_acid_danger_member t1 on t.id = t1.record_id
|
<where>
|
t.is_del=0 and t.name is not null and t.id_card is not null and t.phone is not null
|
<if test="commonPage.userId !=null">
|
and t.user_id = #{commonPage.userId}
|
</if>
|
<if test="commonPage.keyword !=null and commonPage.keyword!=''">
|
and (t.name like concat('%',#{commonPage.keyword},'%') or t.phone like
|
concat('%',#{commonPage.keyword},'%') or t.id_card like concat('%',#{commonPage.keyword},'%'))
|
</if>
|
<if test="commonPage.startTime !=null and commonPage.startTime !=''">
|
and t.create_time between #{commonPage.startTime} and concat(#{commonPage.stopTime},' 23:59:59')
|
</if>
|
<if test="commonPage.isAddress !=null">
|
<if test="commonPage.isAddress == 0">
|
and (local_city is null OR LENGTH(TRIM(local_city)) = 0)
|
</if>
|
<if test="commonPage.isAddress == 1">
|
and local_city is not null AND LENGTH(TRIM(local_city)) > 0
|
</if>
|
</if>
|
<if test="commonPage.departureCity !=null and commonPage.departureCity !=''">
|
and departure_city like concat('%',#{commonPage.departureCity},'%')
|
</if>
|
<if test="commonPage.localCity !=null and commonPage.localCity !='' and commonPage.localCity !='panzhihua'">
|
and local_city like concat('%',#{commonPage.localCity},'%')
|
</if>
|
<if test="commonPage.colorMark !=null and commonPage.colorMark !=''">
|
and color_mark like concat('%',#{commonPage.colorMark},'%')
|
</if>
|
<if test="commonPage.travelCard !=null and commonPage.travelCard !=''">
|
and travel_card like concat('%',#{commonPage.travelCard},'%')
|
</if>
|
</where>
|
order by t.create_time desc
|
</select>
|
|
<select id="fiveCount" resultType="com.panzhihua.common.model.vos.community.reserve.FiveCount">
|
select (select count(*) from com_act_acid_record where is_del=0 <if test="localCity!=null and localCity!=''">and
|
local_city like concat('%',#{localCity},'%')</if>) allCount,
|
(select count(*) from com_act_acid_record where danger_area = '是' and is_del=0<if
|
test="localCity!=null and localCity!=''">and local_city like concat('%',#{localCity},'%')</if>) dangerCount,
|
(select count(*) from com_act_acid_record where color_mark = '绿码' and is_del=0 <if
|
test="localCity!=null and localCity!=''">and local_city like concat('%',#{localCity},'%')</if>) greenMark,
|
(select count(*) from com_act_acid_record where color_mark = '红码' and is_del=0<if
|
test="localCity!=null and localCity!=''">and local_city like concat('%',#{localCity},'%')</if>) redMark,
|
(select count(*) from com_act_acid_record where color_mark = '黄码' and is_del=0<if
|
test="localCity!=null and localCity!=''">and local_city like concat('%',#{localCity},'%')</if>) yellowMark,
|
(select count(*) from com_act_acid_record where travel_card = '是' and is_del=0<if
|
test="localCity!=null and localCity!=''">and local_city like concat('%',#{localCity},'%')</if>) travelCount
|
</select>
|
|
<select id="areaStatics" resultType="com.panzhihua.common.model.vos.community.acid.ComAcidStaticVO">
|
select (select count(*) from com_act_acid_record where is_del=0
|
<if
|
test="localCity!=null and localCity!='' and localCity!='攀枝花市'">and local_city like
|
concat('%',#{localCity},'%')
|
</if>
|
<if test="date!=null and date!=''">and create_time between concat(#{date},' 00:00:00') and concat(#{date},'
|
23:23:59')</if>) allCount,
|
(select count(*) from com_act_acid_record where danger_area = '是' and is_del=0
|
<if
|
test="localCity!=null and localCity!='' and localCity!='攀枝花市'">and local_city like
|
concat('%',#{localCity},'%')
|
</if>
|
<if test="date!=null and date!=''">and create_time between concat(#{date},' 00:00:00') and concat(#{date},'
|
23:23:59')</if>) dangerCount,
|
(select count(*) from com_act_acid_record where color_mark = '绿码' and is_del=0
|
<if test="localCity!=null and localCity!='' and localCity!='攀枝花市'">and local_city like
|
concat('%',#{localCity},'%')
|
</if>
|
<if test="date!=null and date!=''">and create_time between concat(#{date},' 00:00:00') and concat(#{date},'
|
23:23:59')</if>) greenMark,
|
(select count(*) from com_act_acid_record where color_mark = '红码' and is_del=0
|
<if test="localCity!=null and localCity!='' and localCity!='攀枝花市'">and local_city like
|
concat('%',#{localCity},'%')
|
</if>
|
<if test="date!=null and date!=''">and create_time between concat(#{date},' 00:00:00') and concat(#{date},'
|
23:23:59')</if>) redMark,
|
(select count(*) from com_act_acid_record where color_mark = '黄码' and is_del=0
|
<if test="localCity!=null and localCity!='' and localCity!='攀枝花市'">and local_city like
|
concat('%',#{localCity},'%')
|
</if>
|
<if test="date!=null and date!=''">and create_time between concat(#{date},' 00:00:00') and concat(#{date},'
|
23:23:59')</if>) yellowMark,
|
(select count(*) from com_act_acid_record where travel_card = '是' and is_del=0
|
<if test="localCity!=null and localCity!='' and localCity!='攀枝花市'">and local_city like
|
concat('%',#{localCity},'%')
|
</if>
|
<if test="date!=null and date!=''">and create_time between concat(#{date},' 00:00:00') and concat(#{date},'
|
23:23:59')</if>) travelCount
|
</select>
|
|
<select id="countryStatics" resultType="Integer">
|
select count(*) from com_act_acid_record where is_del=0 and departure_city like concat('%',#{departureCity},'%')
|
<if
|
test="date!=null and date!=''">and create_time between concat(#{date},' 00:00:00') and concat(#{date},'
|
23:23:59')
|
</if>
|
<if test="localCity!=null and localCity!='' and localCity!='攀枝花市'">and local_city like
|
concat('%',#{localCity},'%')
|
</if>
|
</select>
|
|
<select id="fiveCountPlus" resultType="com.panzhihua.common.model.vos.community.reserve.FiveCount">
|
select (select count(*) from com_act_acid_record where 1=1 and is_del=0
|
<if test="type == 1">
|
and local_city like
|
concat('%','社区')
|
</if>
|
<if test="type == 2">
|
and local_city like
|
concat('%','村')
|
</if>
|
<if test="date!=null and date!=''">and
|
create_time between concat(#{date},' 00:00:00') and concat(#{date},' 23:23:59')
|
</if>
|
<if test="localCity!=null and localCity!='' and localCity !='panzhihua'">and local_city like
|
concat('%',#{localCity},'%')
|
<if test="type == 1">
|
and local_city like
|
concat('%','社区')
|
</if>
|
<if test="type == 2">
|
and local_city like
|
concat('%','村')
|
</if></if>) allCount,
|
(select count(*) from com_act_acid_record where danger_area = '是' and is_del=0
|
<if test="date!=null and date!=''">and create_time between concat(#{date},' 00:00:00') and concat(#{date},'
|
23:23:59')
|
</if>
|
<if test="type == 1">
|
and local_city like
|
concat('%','社区')
|
</if>
|
<if test="type == 2">
|
and local_city like
|
concat('%','村')
|
</if>
|
<if test="localCity!=null and localCity!='' and localCity !='panzhihua'">and local_city like
|
concat('%',#{localCity},'%')
|
</if>) dangerCount,
|
(select count(*) from com_act_acid_record where color_mark = '绿码' and is_del=0
|
<if test="date!=null and date!=''">and create_time between concat(#{date},' 00:00:00') and concat(#{date},'
|
23:23:59')
|
</if>
|
<if test="localCity!=null and localCity!='' and localCity !='panzhihua'">and local_city like
|
concat('%',#{localCity},'%')</if>
|
<if test="type == 1">
|
and local_city like
|
concat('%','社区')
|
</if>
|
<if test="type == 2">
|
and local_city like
|
concat('%','村')
|
</if>) greenMark,
|
(select count(*) from com_act_acid_record where color_mark = '红码' and is_del=0
|
<if test="date!=null and date!=''">and create_time between concat(#{date},' 00:00:00') and concat(#{date},'
|
23:23:59')
|
</if>
|
<if test="type == 1">
|
and local_city like
|
concat('%','社区')
|
</if>
|
<if test="type == 2">
|
and local_city like
|
concat('%','村')
|
</if>
|
<if test="localCity!=null and localCity!='' and localCity !='panzhihua'">and local_city like
|
concat('%',#{localCity},'%')
|
</if>) redMark,
|
(select count(*) from com_act_acid_record where color_mark = '黄码' and is_del=0
|
<if test="type == 1">
|
and local_city like
|
concat('%','社区')
|
</if>
|
<if test="type == 2">
|
and local_city like
|
concat('%','村')
|
</if>
|
<if test="date!=null and date!=''">and create_time between concat(#{date},' 00:00:00') and concat(#{date},'
|
23:23:59')
|
</if>
|
<if test="localCity!=null and localCity!='' and localCity !='panzhihua'">and local_city like
|
concat('%',#{localCity},'%')
|
</if>) yellowMark,
|
(select count(*) from com_act_acid_record where travel_card = '是' and is_del=0
|
<if test="type == 1">
|
and local_city like
|
concat('%','社区')
|
</if>
|
<if test="type == 2">
|
and local_city like
|
concat('%','村')
|
</if>
|
<if test="date!=null and date!=''">and create_time between concat(#{date},' 00:00:00') and concat(#{date},'
|
23:23:59')
|
</if>
|
<if test="localCity!=null and localCity!='' and localCity !='panzhihua'">and local_city like
|
concat('%',#{localCity},'%')
|
</if>) travelCount,
|
(select count(*) from com_act_acid_record where outside_city = '是' and is_del=0
|
<if test="type == 1">
|
and local_city like
|
concat('%','社区')
|
</if>
|
<if test="type == 2">
|
and local_city like
|
concat('%','村')
|
</if>
|
<if test="date!=null and date!=''">and create_time between concat(#{date},' 00:00:00') and concat(#{date},'
|
23:23:59')
|
</if>
|
<if test="localCity!=null and localCity!='' and localCity !='panzhihua'">and local_city like
|
concat('%',#{localCity},'%')
|
</if>) outsideCount
|
</select>
|
|
<select id="pushStatics" resultType="com.panzhihua.common.model.vos.community.reserve.FiveCount">
|
select (select count(*) from com_act_acid_record where 1=1 and is_del=0
|
<if test="date!=null and date!=''">and
|
create_time between concat(#{date},' 00:00:00') and concat(#{date},' 23:23:59')
|
</if>
|
<if test="localCity!=null and localCity!='' and localCity !='panzhihua'">and local_city like
|
concat('%',#{localCity},'%')</if>) allCount,
|
(select count(*) from com_act_acid_danger_member t LEFT JOIN com_act_acid_danger_member t1 on t.record_id =
|
t1.id where 1=1 and t.is_del=0
|
<if test="date!=null and date!=''">and t.create_time between concat(#{date},'
|
00:00:00') and concat(#{date},' 23:23:59')
|
</if>
|
<if test="localCity!=null and localCity!='' and localCity !='panzhihua'">and t1.local_city like
|
concat('%',#{localCity},'%')</if>) dangerCount
|
</select>
|
|
<select id="selectLastNext" resultType="com.panzhihua.common.model.vos.community.acid.ComActAcidRecordVO">
|
select(select min(id) from com_act_acid_record where id > #{id} and check_status = 0 and is_del =0 <if test="localCity!=null and localCity!='' and localCity !='panzhihua'">and local_city like
|
concat('%',#{localCity},'%')</if>) last_id,
|
(select max(id) as next_id from com_act_acid_record where #{id} > id and check_status = 0 and is_del =0 <if test="localCity!=null and localCity!='' and localCity !='panzhihua'">and local_city like
|
concat('%',#{localCity},'%')</if>) next_id
|
</select>
|
|
<select id="selectAcidCount" resultType="com.panzhihua.common.model.vos.community.acid.ComActAcidChartsVO">
|
select count(*) as numOne from com_act_acid_record where 1=1 and is_del=0
|
<if test="date!=null and date!=''">and
|
create_time between concat(#{date},' 00:00:00') and concat(#{date},' 23:23:59')
|
</if>
|
<if test="localCity!=null and localCity!='' and localCity !='panzhihua'">and local_city like
|
concat('%',#{localCity},'%')
|
</if>
|
</select>
|
|
<select id="selectDangerCount" resultType="com.panzhihua.common.model.vos.community.acid.ComActAcidChartsVO">
|
select (select count(*) as numOne from com_act_acid_danger_member where type = 1
|
<if test="date!=null and date!=''">
|
and create_time between concat(#{date},' 00:00:00') and concat(#{date},' 23:23:59')
|
</if>
|
<if test="localCity!=null and localCity!='' and localCity !='panzhihua'">and relation_name like
|
concat('%',#{localCity},'%')</if>) numOne,
|
(select count(*) as numTwo from com_act_acid_danger_member where type = 2
|
<if test="date!=null and date!=''">and
|
create_time between concat(#{date},' 00:00:00') and concat(#{date},' 23:23:59')
|
</if>
|
<if test="localCity!=null and localCity!='' and localCity !='panzhihua'">and relation_name like
|
concat('%',#{localCity},'%')</if>) numTwo
|
</select>
|
|
<select id="selectCheck" resultType="com.panzhihua.common.model.vos.community.acid.ComActAcidChartsVO">
|
select (select count(id) from com_act_acid_danger_member where type=1
|
<if test="date!=null and date!=''">and
|
create_time between concat(#{date},' 00:00:00') and concat(#{date},' 23:23:59')
|
</if>
|
<if test="localCity!=null and localCity!='' and localCity !='panzhihua'">and relation_name like
|
concat('%',#{localCity},'%')</if>) numTwo,count(id) numOne,
|
case
|
WHEN status = 1 THEN "集中隔离"
|
WHEN status = 2 THEN "居家隔离"
|
WHEN status = 3 THEN "健康监测"
|
WHEN status = 4 THEN "失联或尚需追踪"
|
WHEN status = 5 THEN "排除风险"
|
WHEN status = 6 THEN "暂未管控" end name
|
from com_act_acid_danger_member where type=1
|
<if test="date!=null and date!=''">and
|
create_time between concat(#{date},' 00:00:00') and concat(#{date},' 23:23:59')
|
</if>
|
<if test="localCity!=null and localCity!='' and localCity !='panzhihua'">and relation_name like
|
concat('%',#{localCity},'%')
|
</if>
|
GROUP BY status
|
</select>
|
|
<select id="selectColorMarkGroup"
|
resultType="com.panzhihua.common.model.vos.community.acid.ComActAcidColorChartsVO">
|
SELECT count(1) count_num,color_mark FROM `com_act_acid_record` GROUP BY color_mark
|
</select>
|
<select id="selectColorMarkGroupByMonth"
|
resultType="com.panzhihua.common.model.vos.community.acid.ComActAcidColorChartsVO">
|
SELECT COUNT(1) count_num,date_format(create_time,'%Y-%m') as count_name,color_mark FROM `com_act_acid_record`
|
WHERE date_format(create_time,'%Y-%m') >= date_format(date_sub(now(), INTERVAL 4 MONTH),'%Y-%m') GROUP BY count_name,color_mark
|
</select>
|
|
</mapper>
|