122 lines
6.1 KiB
XML
122 lines
6.1 KiB
XML
<?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="basepro.manager.mapper.RoadCheckStatisticsMapper">
|
|
|
|
<resultMap type="basepro.manager.pojo.RoadCheckStatistics" id="RoadResult">
|
|
<result property="checkTime" column="check_date"></result>
|
|
<result property="deptId" column="org_code"></result>
|
|
<!--<result property="deptType" column="type"></result>-->
|
|
<result property="orgName" column="orgName"></result>
|
|
<result property="allPeopleCount" column="people_count"></result>
|
|
<result property="unusualPeopleCount" column="unusual_people_count"></result>
|
|
<result property="allCarCount" column="car_count"></result>
|
|
<result property="thingsCount" column="goods_count"></result>
|
|
<result property="commitPeopleCount" column="commit_people_count"></result>
|
|
<result property="commitCarCount" column="commit_car_count"></result>
|
|
<result property="taskId" column="task_id"></result>
|
|
<result property="kkid" column="kkid"></result>
|
|
<result property="ptype" column="ptype"></result>
|
|
</resultMap>
|
|
|
|
<select id="getRoadCheckStatistics" parameterType="basepro.manager.pojo.RoadCheckStatistics" resultMap="RoadResult">
|
|
SELECT SUM(all_people_count) people_count, SUM(unusual_people_count) unusual_people_count,SUM(all_car_count) car_count,
|
|
SUM(all_things_count) goods_count,SUM(unusual_car_count) unusual_car_count,SUM(commit_car_count) commit_car_count,
|
|
SUM(commit_people_count) commit_people_count
|
|
FROM tb_task_statistics WHERE (task_id is null or task_id ='') and org_code = #{deptId}
|
|
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
|
and date_format(check_date,'%y%m%d %H%i%s') >= date_format(concat(#{params.beginTime}, ' 00:00:00'),'%y%m%d %H%i%s')
|
|
</if>
|
|
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
|
and date_format(check_date,'%y%m%d %H%i%s') <= date_format(concat(#{params.endTime}, ' 23:59:59'),'%y%m%d %H%i%s')
|
|
</if>
|
|
|
|
</select>
|
|
|
|
<select id="getRoadStatistics" parameterType="basepro.manager.pojo.RoadCheckStatistics" resultMap="RoadResult">
|
|
SELECT all_people_count people_count, unusual_people_count,all_car_count car_count,
|
|
all_things_count goods_count, unusual_car_count, commit_car_count,
|
|
commit_people_count commit_people_count,ptype
|
|
FROM tb_task_statistics WHERE (task_id is null or task_id ='')
|
|
<if test="kkid != null ">
|
|
and kkid = #{kkid}
|
|
</if>
|
|
<if test="deptId != null ">
|
|
and org_code = #{deptId}
|
|
</if>
|
|
<if test="params.beginTime != null and params.beginTime != '' "><!-- 开始时间检索 -->
|
|
and date_format(check_date,'%y%m%d')= date_format(#{params.beginTime},'%y%m%d')
|
|
</if>
|
|
|
|
</select>
|
|
|
|
|
|
<select id="getStuckCheckStatistics" parameterType="basepro.manager.pojo.RoadCheckStatistics" resultMap="RoadResult">
|
|
SELECT SUM(all_people_count) people_count, SUM(unusual_people_count) unusual_people_count,SUM(all_car_count) car_count,
|
|
SUM(all_things_count) goods_count,SUM(unusual_car_count) unusual_car_count,SUM(commit_car_count) commit_car_count,
|
|
SUM(commit_people_count) commit_people_count
|
|
FROM tb_task_statistics WHERE task_id = #{taskId}
|
|
<if test="kkid != null ">
|
|
and kkid = #{kkid}
|
|
</if>
|
|
<if test="deptId != null ">
|
|
and org_code = #{deptId}
|
|
</if>
|
|
<if test="params.beginTime != null and params.beginTime != '' "><!-- 开始时间检索 -->
|
|
and date_format(check_date,'%y%m%d %H%i%s') >= date_format(concat(#{params.beginTime}, ' 00:00:00'),'%y%m%d %H%i%s')
|
|
</if>
|
|
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
|
and date_format(check_date,'%y%m%d %H%i%s') <= date_format(concat(#{params.endTime}, ' 23:59:59'),'%y%m%d %H%i%s')
|
|
</if>
|
|
|
|
</select>
|
|
|
|
<select id="getCheckStatistics" parameterType="basepro.manager.pojo.RoadCheckStatistics" resultMap="RoadResult">
|
|
SELECT all_people_count people_count, unusual_people_count,all_car_count car_count,
|
|
all_things_count goods_count, unusual_car_count, commit_car_count,
|
|
commit_people_count commit_people_count,ptype
|
|
FROM tb_task_statistics WHERE task_id is not null and task_id != ''
|
|
<if test="kkid != null ">
|
|
and kkid = #{kkid}
|
|
</if>
|
|
<if test="deptId != null ">
|
|
and org_code = #{deptId}
|
|
</if>
|
|
<if test="params.beginTime != null and params.beginTime != '' "><!-- 开始时间检索 -->
|
|
and date_format(check_date,'%y%m%d')= date_format(#{params.beginTime},'%y%m%d')
|
|
</if>
|
|
|
|
</select>
|
|
|
|
|
|
<select id="getDept" parameterType="basepro.manager.pojo.RoadCheckStatistics" resultMap="RoadResult">
|
|
SELECT d.dept_id org_code,d.short_name orgName,d.type FROM sys_dept d
|
|
where dept_id != '340000000000'
|
|
<if test="deptId != null and deptId != ''">
|
|
and parent_id = #{deptId}
|
|
</if>
|
|
<if test="deptId1 != null and deptId1 != ''">
|
|
and dept_id = #{deptId1}
|
|
</if>
|
|
<if test="deptType != null and deptType != ''">
|
|
and type = #{deptType}
|
|
</if>
|
|
order by dept_id
|
|
</select>
|
|
|
|
|
|
<select id="unusualCount" parameterType="map" resultType="int">
|
|
SELECT sum(unusual_people_count) FROM tb_task_statistics where and org_code = #{deptId}
|
|
<!--<if test="peopleStatus != null and peopleStatus != ''">
|
|
and people_status like concat('%',#{peopleStatus},'%')
|
|
</if>-->
|
|
<if test="beginTime != null and beginTime != ''">
|
|
and date_format(check_date,'%y%m%d') >= date_format(#{beginTime},'%y%m%d')
|
|
</if>
|
|
<if test="endTime != null and endTime != ''">
|
|
and date_format(check_date,'%y%m%d') <= date_format(#{endTime},'%y%m%d')
|
|
</if>
|
|
</select>
|
|
|
|
</mapper> |