|
@@ -83,21 +83,48 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
DELETE FROM large_plat_project ${ew.customSqlSegment}
|
|
|
</delete>
|
|
|
|
|
|
- <select id="getProjectNum" resultType="Long">
|
|
|
- select count(*) as num from large_plat_project
|
|
|
- where del_flag = '0'
|
|
|
+ <select id="getProjectNum" parameterType="String" resultType="Long">
|
|
|
+ SELECT
|
|
|
+ count(*) AS num
|
|
|
+ FROM
|
|
|
+ large_plat_project a
|
|
|
+ LEFT JOIN large_plat_app_org b ON a.app_org = b.app_org
|
|
|
+ WHERE
|
|
|
+ a.del_flag = '0'
|
|
|
+ AND b.del_flag = '0'
|
|
|
+ <if test="appOrg != '10001'">AND ( c.app_parent_org = #{appOrg} OR c.app_org = #{appOrg} )</if>
|
|
|
</select>
|
|
|
|
|
|
<select id="getProjectNumX" parameterType="String" resultMap="LargeProjectResult">
|
|
|
- select count(*) as num, subdivision from large_plat_project
|
|
|
- where del_flag = '0' and subdivision <= 10
|
|
|
- group by subdivision
|
|
|
+ SELECT
|
|
|
+ count(*) AS num,
|
|
|
+ subdivision
|
|
|
+ FROM
|
|
|
+ large_plat_project a
|
|
|
+ LEFT JOIN large_plat_app_org b ON a.app_org = b.app_org
|
|
|
+ WHERE
|
|
|
+ a.del_flag = '0'
|
|
|
+ AND b.del_flag = '0'
|
|
|
+ <if test="appOrg != '10001'">AND ( c.app_parent_org = #{appOrg} OR c.app_org = #{appOrg} )</if>
|
|
|
+ AND subdivision <= 10
|
|
|
+ GROUP BY
|
|
|
+ subdivision
|
|
|
</select>
|
|
|
|
|
|
<select id="getProjectNumY" parameterType="String" resultMap="LargeProjectResult">
|
|
|
- select count(*) as num, subdivision from large_plat_project
|
|
|
- where del_flag = '0' and subdivision > 10
|
|
|
- group by subdivision
|
|
|
+ SELECT
|
|
|
+ count(*) AS num,
|
|
|
+ subdivision
|
|
|
+ FROM
|
|
|
+ large_plat_project a
|
|
|
+ LEFT JOIN large_plat_app_org b ON a.app_org = b.app_org
|
|
|
+ WHERE
|
|
|
+ a.del_flag = '0'
|
|
|
+ AND b.del_flag = '0'
|
|
|
+ <if test="appOrg != '10001'">AND ( c.app_parent_org = #{appOrg} OR c.app_org = #{appOrg} )</if>
|
|
|
+ AND subdivision >= 10
|
|
|
+ GROUP BY
|
|
|
+ subdivision
|
|
|
</select>
|
|
|
|
|
|
<select id="getCameraNumList" parameterType="String" resultMap="LargeProjectResult">
|
|
@@ -109,19 +136,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
FROM
|
|
|
large_plat_project a
|
|
|
LEFT JOIN large_plat_camera b ON a.id = b.project_id
|
|
|
- WHERE a.del_flag = 0 AND a.app_org = #{appOrg}
|
|
|
+ WHERE a.del_flag = '0' AND a.app_org = #{appOrg}
|
|
|
GROUP BY a.id
|
|
|
</select>
|
|
|
|
|
|
- <select id="getProjectNumThisWeek" resultType="int">
|
|
|
+ <select id="getProjectNumThisWeek" parameterType="String" resultType="int">
|
|
|
SELECT
|
|
|
COUNT(*)
|
|
|
FROM
|
|
|
large_plat_plan a
|
|
|
LEFT JOIN large_plat_project b ON a.project_id = b.id
|
|
|
+ LEFT JOIN large_plat_app_org c ON b.app_org = c.app_org
|
|
|
WHERE
|
|
|
a.del_flag = '0'
|
|
|
AND b.del_flag = '0'
|
|
|
+ AND c.del_flag = '0'
|
|
|
+ AND ( c.app_parent_org = #{appOrg} OR c.app_org = #{appOrg} )
|
|
|
AND (
|
|
|
DATE( a.start_time ) BETWEEN DATE_SUB( CURDATE(), INTERVAL ( DAYOFWEEK( CURDATE()) - 2 ) DAY )
|
|
|
AND DATE_ADD( CURDATE(), INTERVAL ( 8 - DAYOFWEEK( CURDATE())) DAY )
|