Commit 60995989 by 阳浪

数据隔离

parent 2685eca0
......@@ -14,14 +14,14 @@
case when e.type in (11,12,13) and DATE_FORMAT(e.create_time, '%Y-%m-%d') = #{date} then 1 else 0 end as admireNum,
case when e.type in (11,12,13) and DATE_SUB(DATE_FORMAT(e.create_time, '%Y-%m-%d'), INTERVAL -1 DAY) = #{date} then 1 else 0 end as admirePreNum
from event_track e where e.deleted =0
and e.dept_id in (select id from SELECT id FROM cloud_system.authz_user_group where site_id = #{siteId})) a
and e.dept_id in (SELECT id FROM cloud_system.authz_user_group where site_id = #{siteId})) a
</select>
<select id="queryNumByType" resultType="com.yizhi.site.application.vo.site.EventTrackTypeNumVo">
select
e.type,e.sub_type as subType,count(1) as num from event_track e
where e.deleted =0
and e.dept_id in (select id from SELECT id FROM cloud_system.authz_user_group where site_id = #{siteId})
and e.dept_id in (SELECT id FROM cloud_system.authz_user_group where site_id = #{siteId})
<if test="date==4">
and WEEK(e.create_time) = WEEK(now()) and DATE_FORMAT(e.create_time, '%Y') = DATE_FORMAT(now(), '%Y')
</if>
......@@ -56,7 +56,7 @@
select
e.dept_id as deptId,e.dept_name as deptName,count(1) as num from event_track e
where e.deleted =0
and e.dept_id in (select id from SELECT id FROM cloud_system.authz_user_group where site_id = #{siteId})
and e.dept_id in (SELECT id FROM cloud_system.authz_user_group where site_id = #{siteId})
<if test="date==4">
and WEEK(e.create_time) = WEEK(now()) and DATE_FORMAT(e.create_time, '%Y') = DATE_FORMAT(now(), '%Y')
</if>
......@@ -111,7 +111,7 @@
then 1 else
0 end as preNum from event_track e
where e.deleted =0
and e.dept_id in (select id from SELECT id FROM cloud_system.authz_user_group where site_id = #{siteId})
and e.dept_id in (SELECT id FROM cloud_system.authz_user_group where site_id = #{siteId})
<if test="types!=null and types.size()>0">
AND e.type IN
<foreach collection="types" item="item" open="(" separator="," close=")">#{item}</foreach>
......@@ -152,12 +152,12 @@
</if>
then 1 else
0 end as preNum from publication e
and e.site_id = #{siteId}
where e.site_id = #{siteId}
) a
</select>
<select id="getNum" resultType="java.lang.Integer">
select count(1) from event_track e where e.deleted =0
and e.dept_id in (select id from SELECT id FROM cloud_system.authz_user_group where site_id = #{siteId})
and e.dept_id in (SELECT id FROM cloud_system.authz_user_group where site_id = #{siteId})
and e.type=#{type} and e.business_id = #{businessId}
</select>
<select id="queryGropByList" resultType="com.yizhi.site.application.vo.site.EventTrackDeptNumVo">
......@@ -165,12 +165,12 @@
aug.name as deptName,
0 as num
FROM cloud_system.authz_user_group aug
and aug.site_id = #{siteId}
where aug.site_id = #{siteId}
</select>
<select id="getExamTotal" resultType="java.lang.Integer">
SELECT COUNT(DISTINCT create_by_id) FROM cloud_portal.event_track
WHERE sub_type =#{subType} and DATE_FORMAT(create_time,'%Y') = #{year}
and e.dept_id in (select id from SELECT id FROM cloud_system.authz_user_group where site_id = #{siteId})
and dept_id in (SELECT id FROM cloud_system.authz_user_group where site_id = #{siteId})
</select>
<select id="queryTgNumByDept" resultType="com.yizhi.site.application.vo.site.EventTrackTypeNumVo">
select count(1) num ,DATE_FORMAT(create_time, '%m' ) subType from publication where dept_name=#{deptName}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment