Browse Source

修改课题成员统计

master
ccsens_zhengzhichuan 4 weeks ago
parent
commit
9a7087b266
  1. 4
      research-admin/src/main/resources/application-prod.yml
  2. 2
      research-system/src/main/java/com/research/system/domain/vo/GroupVO.java
  3. 7
      research-system/src/main/java/com/research/system/service/impl/KtsGroupServiceImpl.java
  4. 30
      research-system/src/main/resources/mapper/dao/KtsGroupDao.xml
  5. 2
      research-system/src/main/resources/mapper/system/SysUserMapper.xml

4
research-admin/src/main/resources/application-prod.yml

@ -8,8 +8,8 @@ spring:
master:
url: jdbc:mysql://127.0.0.1:3306/open_research?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true
username: root
# password: sdey18aA!
password: csylcx18aA!
password: sdey18aA!
# password: csylcx18aA!
# 从库数据源
slave:
# 从数据源开关/默认关闭

2
research-system/src/main/java/com/research/system/domain/vo/GroupVO.java

@ -276,7 +276,7 @@ public class GroupVO {
if (graduationTime != null) {
return System.currentTimeMillis() >= graduationTime.getTime() ? (byte) 1 : 0;
}
return 0;
return null;
}
public String getType() {

7
research-system/src/main/java/com/research/system/service/impl/KtsGroupServiceImpl.java

@ -259,6 +259,13 @@ public class KtsGroupServiceImpl implements KtsGroupService {
}
}
//判断改课题组是否有未删除的课题组成员
KtsKtGroupMemberExample ktsKtGroupMemberExample = new KtsKtGroupMemberExample();
ktsKtGroupMemberExample.createCriteria().andKtGroupIdIn(dto.getIdList()).andDelFlagEqualTo((byte) 0);
if(ktsKtGroupMemberMapper.countByExample(ktsKtGroupMemberExample) > 0){
throw new BaseException("该课题组有未删除的课题组成员");
}
KtsKtGroupExample ktsKtGroupExample = new KtsKtGroupExample();
ktsKtGroupExample.createCriteria().andIdIn(dto.getIdList());
KtsKtGroupWithBLOBs ktsKtGroup = new KtsKtGroupWithBLOBs();

30
research-system/src/main/resources/mapper/dao/KtsGroupDao.xml

@ -236,12 +236,12 @@
select o.id as orgId,
o.org_name as orgName,
COUNT(m.id) as num,
SUM(CASE WHEN m.graduation_time > now() THEN 1 ELSE 0 END) AS zdNum,
SUM(CASE WHEN (m.graduation_time is null or m.graduation_time > now()) and m.category = 1 THEN 1 ELSE 0 END) AS zdNum,
SUM(CASE WHEN m.graduation_time < now() THEN 1 ELSE 0 END) AS byNum
from prj_proj_org o
left join
kts_kt_group g on g.proj_org_id = o.id and g.del_flag = 0
LEFT JOIN kts_kt_group_member m on m.kt_group_id = g.id and m.del_flag = 0
LEFT JOIN kts_kt_group_member m on m.kt_group_id = g.id and m.del_flag = 0 and m.category = 1
where o.del_flag = 0
group by o.id
</select>
@ -283,7 +283,7 @@
from prj_proj_org o
left join
kts_kt_group g on g.proj_org_id = o.id and g.del_flag = 0
LEFT JOIN kts_kt_group_member m on m.kt_group_id = g.id and m.graduation_time > now()
LEFT JOIN kts_kt_group_member m on m.kt_group_id = g.id and (m.graduation_time > now() or m.graduation_time is null) and m.del_flag = 0
where o.del_flag = 0
group by o.id
</select>
@ -385,11 +385,11 @@
select o.id as orgId,
o.org_name as orgName,
SUM(CASE WHEN m.graduation_time is not null and m.graduation_time &lt;= now() and m.category = 1 THEN 1 ELSE 0 END) AS `by`,
SUM(CASE WHEN m.graduation_time is not null and m.graduation_time > now() and m.category = 1 THEN 1 ELSE 0 END) AS zd
SUM(CASE WHEN (m.graduation_time is null or (m.graduation_time is not null and m.graduation_time > now())) and m.category = 1 THEN 1 ELSE 0 END) AS zd
from prj_proj_org o
left join
kts_kt_group g on g.proj_org_id = o.id and g.del_flag = 0
LEFT JOIN kts_kt_group_member m on m.kt_group_id = g.id
LEFT JOIN kts_kt_group_member m on m.kt_group_id = g.id and m.category = 1 and m.del_flag = 0
where o.del_flag = 0
group by o.id
</select>
@ -425,18 +425,18 @@
<select id="zdStatistics" resultType="com.research.system.domain.vo.GroupVO$ZdStatistics">
select
SUM(CASE WHEN m.graduation_time is not null and m.graduation_time &lt;= now() and m.category = 1 THEN 1 ELSE 0 END) AS `by`,
SUM(CASE WHEN m.graduation_time is not null and m.graduation_time &lt;= now() and m.category = 1 and m.qualification = 5 THEN 1 ELSE 0 END) AS `bySs`,
SUM(CASE WHEN m.graduation_time is not null and m.graduation_time &lt;= now() and m.category = 1 and m.qualification = 6 THEN 1 ELSE 0 END) AS `byBs`,
SUM(CASE WHEN m.graduation_time is not null and m.graduation_time &lt;= now() and m.category = 1 and m.qualification = 7 THEN 1 ELSE 0 END) AS `byBsh`,
SUM(CASE WHEN m.graduation_time is not null and m.graduation_time > now() and m.category = 1 THEN 1 ELSE 0 END) AS zd,
SUM(CASE WHEN m.graduation_time is not null and m.graduation_time > now() and m.category = 1 and m.qualification = 5 THEN 1 ELSE 0 END) AS zdSs,
SUM(CASE WHEN m.graduation_time is not null and m.graduation_time > now() and m.category = 1 and m.qualification = 6 THEN 1 ELSE 0 END) AS zdBs,
SUM(CASE WHEN m.graduation_time is not null and m.graduation_time > now() and m.category = 1 and m.qualification = 7 THEN 1 ELSE 0 END) AS zdBsh
SUM(CASE WHEN (m.graduation_time &lt;= now()) and m.category = 1 THEN 1 ELSE 0 END) AS `by`,
SUM(CASE WHEN ((m.graduation_time &lt;= now())) and m.category = 1 and m.reading_status = 0 THEN 1 ELSE 0 END) AS `bySs`,
SUM(CASE WHEN ((m.graduation_time &lt;= now())) and m.category = 1 and m.reading_status = 1 THEN 1 ELSE 0 END) AS `byBs`,
SUM(CASE WHEN ((m.graduation_time &lt;= now())) and m.category = 1 and m.reading_status = 2 THEN 1 ELSE 0 END) AS `byBsh`,
SUM(CASE WHEN (m.graduation_time is null or (m.graduation_time > now())) and m.category = 1 THEN 1 ELSE 0 END) AS zd,
SUM(CASE WHEN (m.graduation_time is null or (m.graduation_time > now())) and m.category = 1 and m.reading_status = 0 THEN 1 ELSE 0 END) AS zdSs,
SUM(CASE WHEN (m.graduation_time is null or (m.graduation_time > now())) and m.category = 1 and m.reading_status = 1 THEN 1 ELSE 0 END) AS zdBs,
SUM(CASE WHEN (m.graduation_time is null or (m.graduation_time > now())) and m.category = 1 and m.reading_status = 2 THEN 1 ELSE 0 END) AS zdBsh
from prj_proj_org o
left join
kts_kt_group g on g.proj_org_id = o.id and g.del_flag = 0
LEFT JOIN kts_kt_group_member m on m.kt_group_id = g.id
where o.del_flag = 0
LEFT JOIN kts_kt_group_member m on m.kt_group_id = g.id and m.category = 1
where o.del_flag = 0 and m.del_flag = 0 and g.del_flag = 0
</select>
</mapper>

2
research-system/src/main/resources/mapper/system/SysUserMapper.xml

@ -127,7 +127,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult">
<include refid="selectUserVo"/>
where u.user_name = #{userName} and u.del_flag = '0' order by id limit 1
where u.user_name = #{userName} and u.del_flag = '0' order by user_id limit 1
</select>
<select id="selectUserById" parameterType="Long" resultMap="SysUserResult">

Loading…
Cancel
Save