Commit 2685eca0 by 阳浪

数据隔离

parent 67f7ef9c
...@@ -19,28 +19,28 @@ import java.util.List; ...@@ -19,28 +19,28 @@ import java.util.List;
*/ */
public interface EventTrackMapper extends BaseMapper<EventTrack> { public interface EventTrackMapper extends BaseMapper<EventTrack> {
EventTrackDayNumVo getTodayNum(@Param("date") String date); EventTrackDayNumVo getTodayNum(@Param("date") String date,@Param("siteId") Long siteId);
EventTrackDayNumVo getTodayNumByLogin(@Param("date") String date); EventTrackDayNumVo getTodayNumByLogin(@Param("date") String date,@Param("siteId") Long siteId);
DayNumVo getNumByLogin(@Param("date") String date,@Param("dateString") String dateString); DayNumVo getNumByLogin(@Param("date") String date,@Param("dateString") String dateString,@Param("siteId") Long siteId);
DayNumVo getNumByType(@Param("date") String date,@Param("dateString") String dateString,@Param("types")List<Integer> types); DayNumVo getNumByType(@Param("date") String date,@Param("dateString") String dateString,@Param("types")List<Integer> types,@Param("siteId") Long siteId);
DayNumVo getTgNumByType(@Param("date") String date,@Param("dateString") String dateString); DayNumVo getTgNumByType(@Param("date") String date,@Param("dateString") String dateString,@Param("siteId") Long siteId);
List<EventTrackTypeNumVo> queryNumByType(@Param("deptId") Long deptId,@Param("date") String date,@Param("dateString") String dateString,@Param("types")List<Integer> types,@Param("subNameList")List<String> subNameList); List<EventTrackTypeNumVo> queryNumByType(@Param("deptId") Long deptId,@Param("date") String date,@Param("dateString") String dateString,@Param("types")List<Integer> types,@Param("subNameList")List<String> subNameList,@Param("siteId") Long siteId);
List<EventTrackTypeNumVo> queryTgNumByDept(@Param("deptName") String deptName,@Param("typeId")Long typeId); List<EventTrackTypeNumVo> queryTgNumByDept(@Param("deptName") String deptName,@Param("typeId")Long typeId,@Param("siteId") Long siteId);
List<EventTrackDeptNumVo> queryDeptByType(@Param("date") String date,@Param("dateString") String dateString, @Param("types")List<Integer> types); List<EventTrackDeptNumVo> queryDeptByType(@Param("date") String date,@Param("dateString") String dateString, @Param("types")List<Integer> types,@Param("siteId") Long siteId);
Integer getNum(@Param("type")Integer type, @Param("businessId")Long businessId); Integer getNum(@Param("type")Integer type, @Param("businessId")Long businessId,@Param("siteId") Long siteId);
List<EventTrackDeptNumVo> queryGropByList(); List<EventTrackDeptNumVo> queryGropByList(@Param("siteId") Long siteId);
Integer getExamTotal(@Param("subType")String subType,@Param("year")String year); Integer getExamTotal(@Param("subType")String subType,@Param("year")String year,@Param("siteId") Long siteId);
Integer getResearchTotal(@Param("year")String year); Integer getResearchTotal(@Param("year")String year,@Param("siteId") Long siteId);
Integer getResearchJoinTotal(@Param("year")String year); Integer getResearchJoinTotal(@Param("year")String year,@Param("siteId") Long siteId);
} }
...@@ -124,7 +124,8 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr ...@@ -124,7 +124,8 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr
if(ObjectUtils.isEmpty(date)){ if(ObjectUtils.isEmpty(date)){
date = DateUtil.toDay(new Date()); date = DateUtil.toDay(new Date());
} }
return this.baseMapper.getTodayNum(date); RequestContext context = ContextHolder.get();
return this.baseMapper.getTodayNum(date,context.getSiteId());
} }
...@@ -144,7 +145,8 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr ...@@ -144,7 +145,8 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr
return 0; return 0;
} }
return this.baseMapper.getNum(type,businessId); RequestContext context = ContextHolder.get();
return this.baseMapper.getNum(type,businessId,context.getSiteId());
} }
@Override @Override
...@@ -152,21 +154,22 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr ...@@ -152,21 +154,22 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr
if(ObjectUtils.isEmpty(date)){ if(ObjectUtils.isEmpty(date)){
date = "3"; date = "3";
} }
RequestContext context = ContextHolder.get();
if(CollectionUtil.isEmpty(types)){ if(CollectionUtil.isEmpty(types)){
return new DayNumVo(){{setNum(0);setPreNum(0);}}; return new DayNumVo(){{setNum(0);setPreNum(0);}};
} }
String dateString =getDateString(date); String dateString =getDateString(date);
if(Objects.equals(types.get(0),5)){ if(Objects.equals(types.get(0),5)){
return this.baseMapper.getTgNumByType(date,dateString); return this.baseMapper.getTgNumByType(date,dateString,context.getSiteId());
} }
if(Objects.equals(types.get(0),8)){ if(Objects.equals(types.get(0),8)){
String year = DateUtil.toShortYear(new Date()); String year = DateUtil.toShortYear(new Date());
DayNumVo dayNumVo = new DayNumVo(); DayNumVo dayNumVo = new DayNumVo();
dayNumVo.setPreNum(this.baseMapper.getResearchTotal(year)); dayNumVo.setPreNum(this.baseMapper.getResearchTotal(year,context.getSiteId()));
dayNumVo.setNum(this.baseMapper.getResearchJoinTotal(year)); dayNumVo.setNum(this.baseMapper.getResearchJoinTotal(year,context.getSiteId()));
return dayNumVo; return dayNumVo;
} }
return this.baseMapper.getNumByType(date,dateString,types); return this.baseMapper.getNumByType(date,dateString,types,context.getSiteId());
} }
@Override @Override
...@@ -176,6 +179,7 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr ...@@ -176,6 +179,7 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr
} }
String dateString =getDateString(date); String dateString =getDateString(date);
Long id = null; Long id = null;
RequestContext context = ContextHolder.get();
if(!ObjectUtils.isEmpty(subName)) { if(!ObjectUtils.isEmpty(subName)) {
String key = "event_track_type"; String key = "event_track_type";
List<Dictionary> dictionaryList = dictionaryFeignClients.listChildDictionary(key, false, 1); List<Dictionary> dictionaryList = dictionaryFeignClients.listChildDictionary(key, false, 1);
...@@ -194,7 +198,7 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr ...@@ -194,7 +198,7 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr
subNameList = classificationList.stream().map(DataClassification::getName).collect(Collectors.toList()); subNameList = classificationList.stream().map(DataClassification::getName).collect(Collectors.toList());
} }
} }
List<EventTrackTypeNumVo> eventTrackTypeNumVoList = this.baseMapper.queryNumByType(null,date,dateString,types,subNameList); List<EventTrackTypeNumVo> eventTrackTypeNumVoList = this.baseMapper.queryNumByType(null,date,dateString,types,subNameList,context.getSiteId());
if(CollectionUtil.isNotEmpty(subNameList)){ if(CollectionUtil.isNotEmpty(subNameList)){
subNameList.stream().forEach(name->{ subNameList.stream().forEach(name->{
EventTrackTypeNumVo eventTrackTypeNumVo = new EventTrackTypeNumVo(); EventTrackTypeNumVo eventTrackTypeNumVo = new EventTrackTypeNumVo();
...@@ -221,6 +225,7 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr ...@@ -221,6 +225,7 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr
} }
String dateString =getDateString(date); String dateString =getDateString(date);
String key = "event_track_type"; String key = "event_track_type";
RequestContext context = ContextHolder.get();
List<Dictionary> dictionaryList = dictionaryFeignClients.listChildDictionary(key,false,1); List<Dictionary> dictionaryList = dictionaryFeignClients.listChildDictionary(key,false,1);
Map<Integer,String> keyMap = Maps.newHashMap(); Map<Integer,String> keyMap = Maps.newHashMap();
if(CollUtil.isNotEmpty(dictionaryList)){ if(CollUtil.isNotEmpty(dictionaryList)){
...@@ -230,11 +235,11 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr ...@@ -230,11 +235,11 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr
} }
List<EventTrackDeptNumVo> eventTrackDeptNumVoList = this.baseMapper.queryGropByList(); List<EventTrackDeptNumVo> eventTrackDeptNumVoList = this.baseMapper.queryGropByList(context.getSiteId());
if(CollUtil.isNotEmpty(eventTrackDeptNumVoList)){ if(CollUtil.isNotEmpty(eventTrackDeptNumVoList)){
String finalDate = date; String finalDate = date;
eventTrackDeptNumVoList.stream().forEach(eventTrackDeptNumVo -> { eventTrackDeptNumVoList.stream().forEach(eventTrackDeptNumVo -> {
List<EventTrackTypeNumVo> eventTrackTypeNumVoList = this.baseMapper.queryNumByType(eventTrackDeptNumVo.getDeptId(),finalDate, dateString,types,null); List<EventTrackTypeNumVo> eventTrackTypeNumVoList = this.baseMapper.queryNumByType(eventTrackDeptNumVo.getDeptId(),finalDate, dateString,types,null,context.getSiteId());
if(CollectionUtil.isNotEmpty(eventTrackTypeNumVoList)){ if(CollectionUtil.isNotEmpty(eventTrackTypeNumVoList)){
List<EventTrackTypeNumVo> voList = Lists.newArrayList(); List<EventTrackTypeNumVo> voList = Lists.newArrayList();
eventTrackTypeNumVoList.stream().forEach(numVo->{ eventTrackTypeNumVoList.stream().forEach(numVo->{
...@@ -290,7 +295,9 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr ...@@ -290,7 +295,9 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr
@Override @Override
public List<EventTrackDeptNumVo> queryTgNumByDept(Long typeId) { public List<EventTrackDeptNumVo> queryTgNumByDept(Long typeId) {
List<EventTrackDeptNumVo> eventTrackDeptNumVoList = this.baseMapper.queryGropByList();
RequestContext context = ContextHolder.get();
List<EventTrackDeptNumVo> eventTrackDeptNumVoList = this.baseMapper.queryGropByList(context.getSiteId());
LocalDate today = LocalDate.now(); LocalDate today = LocalDate.now();
List<Integer> recentMonths = new ArrayList<>(); List<Integer> recentMonths = new ArrayList<>();
...@@ -302,7 +309,7 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr ...@@ -302,7 +309,7 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr
if(CollUtil.isNotEmpty(eventTrackDeptNumVoList)){ if(CollUtil.isNotEmpty(eventTrackDeptNumVoList)){
eventTrackDeptNumVoList.stream().forEach(eventTrackDeptNumVo -> { eventTrackDeptNumVoList.stream().forEach(eventTrackDeptNumVo -> {
List<EventTrackTypeNumVo> eventTrackTypeNumVoList = this.baseMapper.queryTgNumByDept(eventTrackDeptNumVo.getDeptName(),typeId); List<EventTrackTypeNumVo> eventTrackTypeNumVoList = this.baseMapper.queryTgNumByDept(eventTrackDeptNumVo.getDeptName(),typeId,context.getSiteId());
if(CollectionUtil.isNotEmpty(eventTrackTypeNumVoList)){ if(CollectionUtil.isNotEmpty(eventTrackTypeNumVoList)){
List<EventTrackTypeNumVo> voList = Lists.newArrayList(); List<EventTrackTypeNumVo> voList = Lists.newArrayList();
eventTrackTypeNumVoList.stream().forEach(numVo->{ eventTrackTypeNumVoList.stream().forEach(numVo->{
...@@ -373,7 +380,8 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr ...@@ -373,7 +380,8 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr
@Override @Override
public Integer getExamTotal(String subType,String year) { public Integer getExamTotal(String subType,String year) {
return this.baseMapper.getExamTotal(subType,year); RequestContext context = ContextHolder.get();
return this.baseMapper.getExamTotal(subType,year,context.getSiteId());
} }
public String getDateString(String date) { public String getDateString(String date) {
......
...@@ -44,6 +44,8 @@ public class SystemMailboxServiceImpl extends ServiceImpl<SystemMailboxMapper,Sy ...@@ -44,6 +44,8 @@ public class SystemMailboxServiceImpl extends ServiceImpl<SystemMailboxMapper,Sy
public Page<SystemMailbox> selectPage(SystemMailboxConditionVo conditionVo){ public Page<SystemMailbox> selectPage(SystemMailboxConditionVo conditionVo){
Page<SystemMailbox> page = new Page<>(conditionVo.getPageNo(), conditionVo.getPageSize()); Page<SystemMailbox> page = new Page<>(conditionVo.getPageNo(), conditionVo.getPageSize());
EntityWrapper<SystemMailbox> entityWrapper = new EntityWrapper(); EntityWrapper<SystemMailbox> entityWrapper = new EntityWrapper();
RequestContext context = ContextHolder.get();
entityWrapper.eq("site_id",context.getSiteId());
if(ObjectUtil.isNotEmpty(conditionVo.getContactName())){ if(ObjectUtil.isNotEmpty(conditionVo.getContactName())){
entityWrapper.like("contact_name",conditionVo.getContactName()); entityWrapper.like("contact_name",conditionVo.getContactName());
} }
...@@ -97,6 +99,8 @@ public class SystemMailboxServiceImpl extends ServiceImpl<SystemMailboxMapper,Sy ...@@ -97,6 +99,8 @@ public class SystemMailboxServiceImpl extends ServiceImpl<SystemMailboxMapper,Sy
systemMailBox.setDeleted(DeletedEnum.NO.getValue()); systemMailBox.setDeleted(DeletedEnum.NO.getValue());
BeanUtils.copyProperties(systemMailBoxVo,systemMailBox); BeanUtils.copyProperties(systemMailBoxVo,systemMailBox);
Long id = systemMailBox.getId(); Long id = systemMailBox.getId();
RequestContext context = ContextHolder.get();
systemMailBox.setSiteId(context.getSiteId());
if(id==null||id==0L) { if(id==null||id==0L) {
id = idGenerator.generate(); id = idGenerator.generate();
systemMailBox.setId(id); systemMailBox.setId(id);
......
...@@ -13,13 +13,15 @@ ...@@ -13,13 +13,15 @@
case when e.type not in(1,3,4,5,11,12,13) and DATE_SUB(DATE_FORMAT(e.create_time, '%Y-%m-%d'), INTERVAL -1 DAY) = #{date} then 1 else 0 end as readPreNum, case when e.type not in(1,3,4,5,11,12,13) and DATE_SUB(DATE_FORMAT(e.create_time, '%Y-%m-%d'), INTERVAL -1 DAY) = #{date} then 1 else 0 end as readPreNum,
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_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 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) a 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
</select> </select>
<select id="queryNumByType" resultType="com.yizhi.site.application.vo.site.EventTrackTypeNumVo"> <select id="queryNumByType" resultType="com.yizhi.site.application.vo.site.EventTrackTypeNumVo">
select select
e.type,e.sub_type as subType,count(1) as num from event_track e e.type,e.sub_type as subType,count(1) as num from event_track e
where e.deleted =0 where e.deleted =0
and e.dept_id in (select id from SELECT id FROM cloud_system.authz_user_group where site_id = #{siteId})
<if test="date==4"> <if test="date==4">
and WEEK(e.create_time) = WEEK(now()) and DATE_FORMAT(e.create_time, '%Y') = DATE_FORMAT(now(), '%Y') and WEEK(e.create_time) = WEEK(now()) and DATE_FORMAT(e.create_time, '%Y') = DATE_FORMAT(now(), '%Y')
</if> </if>
...@@ -54,6 +56,7 @@ ...@@ -54,6 +56,7 @@
select select
e.dept_id as deptId,e.dept_name as deptName,count(1) as num from event_track e e.dept_id as deptId,e.dept_name as deptName,count(1) as num from event_track e
where e.deleted =0 where e.deleted =0
and e.dept_id in (select id from SELECT id FROM cloud_system.authz_user_group where site_id = #{siteId})
<if test="date==4"> <if test="date==4">
and WEEK(e.create_time) = WEEK(now()) and DATE_FORMAT(e.create_time, '%Y') = DATE_FORMAT(now(), '%Y') and WEEK(e.create_time) = WEEK(now()) and DATE_FORMAT(e.create_time, '%Y') = DATE_FORMAT(now(), '%Y')
</if> </if>
...@@ -108,6 +111,7 @@ ...@@ -108,6 +111,7 @@
then 1 else then 1 else
0 end as preNum from event_track e 0 end as preNum from event_track e
where e.deleted =0 where e.deleted =0
and e.dept_id in (select id from SELECT id FROM cloud_system.authz_user_group where site_id = #{siteId})
<if test="types!=null and types.size()>0"> <if test="types!=null and types.size()>0">
AND e.type IN AND e.type IN
<foreach collection="types" item="item" open="(" separator="," close=")">#{item}</foreach> <foreach collection="types" item="item" open="(" separator="," close=")">#{item}</foreach>
...@@ -148,10 +152,12 @@ ...@@ -148,10 +152,12 @@
</if> </if>
then 1 else then 1 else
0 end as preNum from publication e 0 end as preNum from publication e
and e.site_id = #{siteId}
) a ) a
</select> </select>
<select id="getNum" resultType="java.lang.Integer"> <select id="getNum" resultType="java.lang.Integer">
select count(1) from event_track e where e.deleted =0 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.type=#{type} and e.business_id = #{businessId} and e.type=#{type} and e.business_id = #{businessId}
</select> </select>
<select id="queryGropByList" resultType="com.yizhi.site.application.vo.site.EventTrackDeptNumVo"> <select id="queryGropByList" resultType="com.yizhi.site.application.vo.site.EventTrackDeptNumVo">
...@@ -159,14 +165,17 @@ ...@@ -159,14 +165,17 @@
aug.name as deptName, aug.name as deptName,
0 as num 0 as num
FROM cloud_system.authz_user_group aug FROM cloud_system.authz_user_group aug
and aug.site_id = #{siteId}
</select> </select>
<select id="getExamTotal" resultType="java.lang.Integer"> <select id="getExamTotal" resultType="java.lang.Integer">
SELECT COUNT(DISTINCT create_by_id) FROM cloud_portal.event_track SELECT COUNT(DISTINCT create_by_id) FROM cloud_portal.event_track
WHERE sub_type =#{subType} and DATE_FORMAT(create_time,'%Y') = #{year} 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})
</select> </select>
<select id="queryTgNumByDept" resultType="com.yizhi.site.application.vo.site.EventTrackTypeNumVo"> <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} select count(1) num ,DATE_FORMAT(create_time, '%m' ) subType from publication where dept_name=#{deptName}
and site_id = #{siteId}
<if test="typeId!=null"> <if test="typeId!=null">
and (type_one = #{typeId} or type_two = #{typeId} ) and (type_one = #{typeId} or type_two = #{typeId} )
</if> </if>
...@@ -180,6 +189,7 @@ ...@@ -180,6 +189,7 @@
cloud_research.research cloud_research.research
where where
deleted = 0 deleted = 0
and site_id = #{siteId}
and state != 0 and state != 0
and DATE_FORMAT(create_time, '%Y') = #{year} and DATE_FORMAT(create_time, '%Y') = #{year}
</select> </select>
...@@ -197,15 +207,16 @@ ...@@ -197,15 +207,16 @@
where where
deleted = 0 deleted = 0
and state != 0 and state != 0
and site_id = #{siteId}
and DATE_FORMAT(create_time, '%Y') = #{year}) and DATE_FORMAT(create_time, '%Y') = #{year})
</select> </select>
<select id="getTodayNumByLogin" resultType="com.yizhi.site.application.vo.site.EventTrackDayNumVo"> <select id="getTodayNumByLogin" resultType="com.yizhi.site.application.vo.site.EventTrackDayNumVo">
select sum(loginNum) loginNum,sum(loginPreNum) loginPreNum from ( select sum(loginNum) loginNum,sum(loginPreNum) loginPreNum from (
SELECT count(distinct account_id) loginNum,0 loginPreNum FROM cloud_system.login_log where login_type =2 SELECT count(distinct account_id) loginNum,0 loginPreNum FROM cloud_system.login_log where login_type =2
and DATE_FORMAT(login_date, '%Y-%m-%d') = #{date} and DATE_FORMAT(login_date, '%Y-%m-%d') = #{date} and site_id = #{siteId}
union all union all
SELECT 0 loginNum,count(distinct account_id) loginPreNum FROM cloud_system.login_log where login_type =2 SELECT 0 loginNum,count(distinct account_id) loginPreNum FROM cloud_system.login_log where login_type =2
and DATE_SUB(DATE_FORMAT(login_date, '%Y-%m-%d'), INTERVAL -1 DAY) = #{date} and DATE_SUB(DATE_FORMAT(login_date, '%Y-%m-%d'), INTERVAL -1 DAY) = #{date} and site_id = #{siteId}
) a ) a
</select> </select>
<select id="getNumByLogin" resultType="com.yizhi.site.application.vo.site.DayNumVo"> <select id="getNumByLogin" resultType="com.yizhi.site.application.vo.site.DayNumVo">
...@@ -223,6 +234,7 @@ ...@@ -223,6 +234,7 @@
<if test="date==1"> <if test="date==1">
and DATE_FORMAT(login_date, '%Y') = #{dateString} and DATE_FORMAT(login_date, '%Y') = #{dateString}
</if> </if>
and site_id = #{siteId}
union all union all
SELECT 0 loginNum,count(distinct account_id) loginPreNum FROM cloud_system.login_log where login_type =2 SELECT 0 loginNum,count(distinct account_id) loginPreNum FROM cloud_system.login_log where login_type =2
and DATE_SUB(DATE_FORMAT(login_date, '%Y-%m-%d'), INTERVAL -1 DAY) = #{date} and DATE_SUB(DATE_FORMAT(login_date, '%Y-%m-%d'), INTERVAL -1 DAY) = #{date}
...@@ -238,6 +250,7 @@ ...@@ -238,6 +250,7 @@
<if test="date==1"> <if test="date==1">
and DATE_FORMAT(DATE_SUB(DATE_FORMAT(login_date, '%Y-%m-%d'), INTERVAL 1 YEAR),'%Y') = #{dateString} and DATE_FORMAT(DATE_SUB(DATE_FORMAT(login_date, '%Y-%m-%d'), INTERVAL 1 YEAR),'%Y') = #{dateString}
</if> </if>
and site_id = #{siteId}
) a ) a
</select> </select>
</mapper> </mapper>
\ No newline at end of file
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