首页查询数据问题修改
This commit is contained in:
parent
a53921de80
commit
f2adef8a99
|
|
@ -413,17 +413,16 @@
|
|||
|
||||
<select id="getAttDayList" resultType="com.bonus.system.att.entity.AttDataDetailsBean">
|
||||
SELECT
|
||||
su.user_name, so.org_name, a.*
|
||||
su.user_name,
|
||||
so.org_name,
|
||||
v.*
|
||||
FROM
|
||||
sys_user su
|
||||
LEFT JOIN v_att_update_data a ON a.user_id = su.user_id
|
||||
LEFT JOIN att_group_person_relation agpr ON agpr.user_id = su.user_id
|
||||
(select * FROM att_setting_history WHERE current_day = #{attCurrentDay}) ash
|
||||
LEFT JOIN sys_user su ON ash.user_id = su.user_id
|
||||
LEFT JOIN ( SELECT * FROM v_att_update_data WHERE att_current_day = #{attCurrentDay} ) v on su.user_id = v.user_id
|
||||
LEFT JOIN sys_user_org org ON org.user_id = su.user_id
|
||||
left join sys_organization so on so.id = org.org_id
|
||||
WHERE su.is_active = 1 AND agpr.is_active = 1
|
||||
<if test="attCurrentDay != null and attCurrentDay != ''">
|
||||
AND att_current_day = #{attCurrentDay}
|
||||
</if>
|
||||
LEFT JOIN sys_organization so ON so.id = org.org_id
|
||||
<where>
|
||||
<if test="attendType == 1 || attendType == '1'">
|
||||
<if test='attStatus == "1"'>
|
||||
and ( toWorkAttStatus = #{attStatus} OR offWorkAttStatus = #{attStatus} )
|
||||
|
|
@ -447,7 +446,10 @@
|
|||
<if test="userName != null and userName != ''">
|
||||
AND su.user_name like concat('%', #{userName}, '%')
|
||||
</if>
|
||||
GROUP BY agpr.user_id
|
||||
</where>
|
||||
|
||||
GROUP BY
|
||||
ash.user_id
|
||||
</select>
|
||||
<select id="getAttDayReportDetailsListData" resultType="com.bonus.system.att.entity.AttDataDetailsBean">
|
||||
select su.user_name, so.org_name, v.* from v_att_update_data v
|
||||
|
|
|
|||
|
|
@ -5,15 +5,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<mapper namespace="com.bonus.system.index.dao.HomePageDao">
|
||||
|
||||
<select id="getTodayAttData" resultType="com.bonus.system.index.entity.IndexTodayAttBean">
|
||||
select a.shouldAttNum, a.actualAttNum,(a.shouldAttNum - a.actualAttNum) as noActualAttNum, TRUNCATE(a.actualAttNum /
|
||||
a.shouldAttNum * 100, 0) as attRate from (
|
||||
select count(agpr.user_id ) as shouldAttNum, count(a.user_id) as actualAttNum
|
||||
from sys_user su left join (
|
||||
select * from v_att_update_data where att_current_day = #{date}
|
||||
and (toWorkAttStatus = 1 or offWorkAttStatus = 1)
|
||||
) a on a.user_id = su.user_id
|
||||
LEFT JOIN att_group_person_relation agpr on agpr.user_id = su.user_id and agpr.is_active = 1
|
||||
where su.is_active = 1
|
||||
SELECT a.shouldAttNum, a.actualAttNum,( a.shouldAttNum - a.actualAttNum ) AS noActualAttNum,
|
||||
TRUNCATE ( a.actualAttNum / a.shouldAttNum * 100, 0 ) AS attRate
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
count( ash.user_id ) AS shouldAttNum,
|
||||
count( v.user_id ) AS actualAttNum
|
||||
FROM
|
||||
( SELECT * FROM att_setting_history WHERE current_day = #{date} ) ash
|
||||
LEFT JOIN sys_user su ON ash.user_id = su.user_id
|
||||
LEFT JOIN ( SELECT * FROM v_att_update_data WHERE att_current_day = #{date} AND ( toWorkAttStatus = 1 OR offWorkAttStatus = 1 ) ) v ON su.user_id = v.user_id
|
||||
) a
|
||||
</select>
|
||||
|
||||
|
|
|
|||
|
|
@ -2,4 +2,4 @@
|
|||
2.AttSourceDataMapper.xml 中 gz_cloud_test -> gz_cloud
|
||||
3.WechatPushMapper.xml 中 gz_cloud_test -> gz_cloud
|
||||
4.com.bonus.system.att.utils.IpAndPathConfig 修改对应环境
|
||||
5.com.bonus.system.att.tasks AttTasks 与 WechatTasks 定时器开启
|
||||
5.com.bonus.system.att.tasks NewAttTask 与 WechatTasks 定时器开启
|
||||
Loading…
Reference in New Issue