Newer
Older
zq-big-sreen / target / classes / mapper / cms / CmsDataMapper.xml
casic_zt on 28 May 2024 2 KB 大屏统计数据不对修改
<?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.casic.dao.cms.CmsDataMapper">

    <select id="countElectronicDevice" resultType="Integer">
        SELECT  count(*)
        FROM   marker
        WHERE  isvalid=1
    </select>


    <select id="countElectronicTask" resultType="Map">
         SELECT  road AS "roadName",count(td.task)  AS  "taskCount"
         FROM  marker   m
         join  taskdetail   td  ON  td.markerid=m.id
         GROUP BY  road
    </select>

    <select id="getTotalWorkOrder" resultType="Integer">
		SELECT   count(*)
		FROM     task
		where  isvalid='1'
        <if test="beginTime != null and beginTime != '' ">
            AND begindate <![CDATA[ >= ]]>
            TO_DATE(#{beginTime},'yyyy-MM-dd HH24:mi')
        </if>
        <if test="endTime != null and endTime != ''">
            AND begindate  <![CDATA[ <= ]]>
            TO_DATE(#{endTime},'yyyy-MM-dd HH24:mi')
        </if>

    </select>

    <select id="getCompleteWorkOrder" resultType="Integer">
		SELECT   count(*)
		FROM     task
		where  isvalid='1'
		AND     status='2'
        <if test="beginTime != null and beginTime != '' ">
            AND begindate <![CDATA[ >= ]]>
            TO_DATE(#{beginTime},'yyyy-MM-dd HH24:mi')
        </if>
        <if test="endTime != null and endTime != ''">
            AND begindate  <![CDATA[ <= ]]>
            TO_DATE(#{endTime},'yyyy-MM-dd HH24:mi')
        </if>
    </select>

    <select id="getTotalTask" resultType="Integer">
		SELECT   count(*)
		FROM     taskdetail
        join     task    ON   task.id=taskdetail.task
        WHERE 1=1
        <if test="beginTime != null and beginTime != '' ">
            AND begindate <![CDATA[ >= ]]>
            TO_DATE(#{beginTime},'yyyy-MM-dd HH24:mi')
        </if>
        <if test="endTime != null and endTime != ''">
            AND begindate  <![CDATA[ <= ]]>
            TO_DATE(#{endTime},'yyyy-MM-dd HH24:mi')
        </if>
    </select>

    <select id="getTotalEvent" resultType="Integer">
		SELECT   count(*)
		FROM   event
        WHERE  1=1
        <if test="beginTime != null and beginTime != '' ">
            AND create_time <![CDATA[ >= ]]>
            TO_DATE(#{beginTime},'yyyy-MM-dd HH24:mi')
        </if>
        <if test="endTime != null and endTime != ''">
            AND create_time  <![CDATA[ <= ]]>
            TO_DATE(#{endTime},'yyyy-MM-dd HH24:mi')
        </if>
    </select>

</mapper>