update code

dev_xds
haha 2024-04-06 21:21:55 +08:00
parent 194d6214c6
commit 9b3feddcfb
8 changed files with 33 additions and 31 deletions

View File

@ -213,14 +213,14 @@ public class ProblemmodifyController extends BaseController {
* @return
*/
@GetMapping("/getMonitAndWarning")
public AjaxResult getMonitAndWarning(long deptId,long projectId,String proType){
public AjaxResult getMonitAndWarning(long deptId,long projectId){
SmzSspProblemmodifyWhere where=new SmzSspProblemmodifyWhere();
if(deptId<=0){
if (SecurityUtils.isUserB()) {
where.setPrjIds(getProjectIds());
}
}
String key="problemmodify_getMonitAndWarning-"+deptId+"_"+projectId+"_"+proType+Md5Utils.hash(where.getPrjIds());
String key="problemmodify_getMonitAndWarning-"+deptId+"_"+projectId+"_"+where.getProType()+Md5Utils.hash(where.getPrjIds());
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);
@ -229,9 +229,6 @@ public class ProblemmodifyController extends BaseController {
where.setDeptId(deptId);
where.setProjectId(projectId);
where.setStartDate(new Date());
if(StringUtils.isNotNull(proType) && Objects.equals(proType,"0")){
where.setProType(proType);
}
Map<String,List<Map<String, Object>>> map=new HashMap<>();
//map.put("today",smzSspProblemmodifyService.countByDate(where));

View File

@ -93,7 +93,7 @@ public class ProjectController extends BaseController {
}
@GetMapping("/groupByProjectCategory")
public AjaxResult groupByProjectCategory(long deptId,String proType){
public AjaxResult groupByProjectCategory(long deptId){
SurProject where=new SurProject();
if(deptId<=0){
if (SecurityUtils.isUserB()) {
@ -102,15 +102,11 @@ public class ProjectController extends BaseController {
}else{
where.setDeptId(deptId);
}
String key="bgscreen_prj_groupByProjectCategory_"+deptId+"_"+proType+"_"+ Md5Utils.hash(where.getPrjIds());
String key="bgscreen_prj_groupByProjectCategory_"+deptId+"_"+where.getProType()+"_"+ Md5Utils.hash(where.getPrjIds());
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return success(obj);
}
if(StringUtils.isNotNull(proType) && !"0".equals(proType)){
where.setProjectType(proType);
}
List<SurProject> list= isurProjectService.groupByProjectCategory(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return success(list);

View File

@ -353,8 +353,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="groupAllByComany" parameterType="SurProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
select g.companyTypeId,count(1) id from sur_project_attendance_user u, sur_project_attendance_cfg c,view_sur_project_attendance_group g,sur_project sp
select g.companyTypeId,count(1) id
from sur_project_attendance_user u, sur_project_attendance_cfg c,view_sur_project_attendance_group g,
sur_project sp
where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId and u.state=0 and c.project_id = sp.id
and sp.isDel=0 and sp.progressVisible=0
and g.companyTypeId in (0,1,2,3,4,5,6,8)
<if test="projectId!=null and projectId>0">
and c.project_id=#{projectId}
@ -406,7 +409,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="todayAttendance" parameterType="SurProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
select ady.* from sur_project_attendance_data_${year} ady
left join sur_project sp on sp.id = ady.projectId
<where>
where sp.isDel=0 and sp.progressVisible=0
<if test="projectId!=null and projectId>0">
and ady.projectId=#{projectId}
</if>
@ -430,13 +433,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</if>
<if test="attendanceTime != null and attendanceTime != ''"> and date(ady.attendance_time) =date(#{attendanceTime})</if>
</where>
</select>
<select id="groupTodayCompanyTypeId" parameterType="SurProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
select ady.companyTypeId,count(1) id from sur_project_attendance_data_${year} ady
left join sur_project sp on sp.id = ady.projectId
<where>
where sp.isDel=0 and sp.progressVisible=0
<if test="projectId!=null and projectId>0">
and ady.projectId=#{projectId}
</if>
@ -451,7 +454,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</if>
<if test="attendanceTime != null and attendanceTime != ''"> and date(ady.attendance_time) =date(#{attendanceTime})</if>
</where>
group by ady.companyTypeId
</select>

View File

@ -520,7 +520,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
b.project_id,b.sub_dept_id, g.teamname remark,g.companyName degreeName
FROM sur_project_attendance_user u,sur_project_attendance_cfg b,view_sur_project_attendance_group g
left join sur_project sp on b.project_id = sp.id
WHERE u.cfgid=b.id and u.state=0 and u.companyId=g.companyId
WHERE u.cfgid=b.id and u.state=0 and u.companyId=g.companyId and sp.isDel=0 and sp.progressVisible=0
<if test="id==101">
and g.companyTypeId in (1,6)
</if>
@ -550,6 +550,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT p.id, p.projectName NAME,c.dept_name groupName,g.companyTypeId companyId,COUNT(1) cfgid
FROM sur_project_attendance_user u,sur_project_attendance_cfg b,view_sur_project_attendance_group g,sur_project p,sys_dept c
where u.cfgid=b.id and u.state=0 and u.companyId=g.companyId and b.project_id=p.id and c.dept_id=b.sub_dept_id
and p.isDel=0 and p.progressVisible=0
and g.companyTypeId in (1,6,0,2,3,4,5,8)
<if test="deptId!=null and deptId>0">
and p.deptId=#{deptId}

View File

@ -114,7 +114,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT 10 cost_type , SUM(spco.money) money FROM sur_project_cost_output spco
left join sur_project sp on sp.id = spco.project_id
WHERE (spco.cost_type=2 AND spco.YEAR &lt;=#{year} )
WHERE (spco.cost_type=2 AND spco.YEAR &lt;=#{year} ) and sp.isDel=0 and sp.progressVisible=0
<if test="id!=null and id>0"> and sp.deptId = #{id}</if>
<if test="proType != null and proType != ''"> and sp.projectType = #{proType}</if>
<if test="projectId!=null and projectId>0">
@ -125,6 +125,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT 2 cost_type , SUM(spco.money) money FROM sur_project_cost_output spco
left join sur_project sp on sp.id = spco.project_id
WHERE (spco.cost_type=9 AND spco.YEAR=#{year} AND spco.MONTH &lt;= #{month} )
and sp.isDel=0 and sp.progressVisible=0
<if test="id!=null and id>0"> and sp.deptId = #{id}</if>
<if test="proType != null and proType != ''"> and sp.projectType = #{proType}</if>
<if test="projectId!=null and projectId>0">
@ -135,6 +136,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT 9 cost_type , SUM(spco.money) money FROM sur_project_cost_output spco
left join sur_project sp on sp.id = spco.project_id
WHERE (spco.cost_type=9 AND spco.YEAR=#{year} AND spco.MONTH= #{month} )
and sp.isDel=0 and sp.progressVisible=0
<if test="id!=null and id>0"> and sp.deptId = #{id}</if>
<if test="proType != null and proType != ''"> and sp.projectType = #{proType}</if>
<if test="projectId!=null and projectId>0">

View File

@ -85,7 +85,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
sur_project_dept_wroks spdw
left join sur_project sp on spdw.project_id=sp.id
<where>
and spdw.is_del=0
and spdw.is_del=0 and sp.progressVisible=0 and sp.isDel=0
<if test="projectId != null and projectId>0"> and spdw.project_id = #{projectId}</if>
<if test="deptId != null and deptId>0"> and sp.deptId = #{deptId}</if>
<if test="prjIds !=null and prjIds.size()>0">
@ -186,7 +186,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
sur_project_dept_wroks spdw
LEFT JOIN sur_project prj ON spdw.project_id=prj.id
LEFT JOIN sys_dept dept ON spdw.dept_id=dept.dept_id
WHERE spdw.is_del=0
WHERE spdw.is_del=0 and prj.progressVisible=0 and prj.isDel=0
<if test="projectId != null and projectId>0"> and spdw.project_id = #{projectId}</if>
<if test="deptId != null and deptId>0"> and spdw.dept_id = #{deptId}</if>
<if test="prjIds !=null and prjIds.size()>0">

View File

@ -349,11 +349,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="groupByProjectCategory" parameterType="SurProject" resultMap="SurProjectResult">
SELECT d.dict_value dept_name,d.dict_label projectName,p.projectSchedule ,COUNT(1) deptId FROM
SELECT d.dict_value dept_name,d.dict_label projectName,p.projectSchedule ,COUNT(p.id) deptId FROM
(SELECT * FROM sys_dict_data WHERE dict_type='project_category') d
LEFT JOIN
(SELECT projectType,IF(projectSchedule IS NULL,1,projectSchedule) projectSchedule FROM sur_project WHERE isDel=0
(SELECT projectType,IF(projectSchedule IS NULL,1,projectSchedule) projectSchedule,id FROM sur_project
WHERE isDel=0 and progressVisible=0
<if test="deptId!=null and deptId>0">and deptid=#{deptId}</if>
<if test='proType != null and proType !=""'> and projectType = #{proType}</if>
<if test="projectType != null and projectType != ''"> and projectType = #{projectType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and id in

View File

@ -435,7 +435,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join sys_dict_data sd on sd.dict_value=sp.danger_type
<if test="infoType==0">and sd.dict_type = 'ssp_aqyhlx'</if>
<if test="infoType==1">and sd.dict_type = 'ssp_zlyhlx'</if>
WHERE sp.isDel = 0
WHERE sp.isDel = 0 and p.progressVisible=0 and p.isDel=0
AND sp.infotype = #{infoType}
<if test="roleType > 0">AND sp.roletype=#{roleType}</if>
<if test="startDate!=null">and DATE(sp.createtime) &gt;= DATE(#{startDate})</if>
@ -559,7 +559,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT p.infotype,COUNT(1) as total
FROM smz_ssp_problemmodify p
left join sur_project sp on sp.id=p.projectId
WHERE p.isDel=0
WHERE p.isDel=0 and sp.progressVisible=0 and sp.isDel=0
<if test="projectId > 0"> and p.projectId=#{projectId}</if>
<if test="deptId > 0 ">and sp.deptid = #{deptId}</if>
<if test='proType != null and proType != "" and proType != "0"'> and sp.projectType = #{proType}</if>
@ -574,7 +574,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
UNION ALL
select '96' as infotype,count(1) as total from dev_ai_project_data ad
left join sur_project sp on ad.project_id=sp.id
where 1=1
where sp.progressVisible=0 and sp.isDel=0
<if test="projectId &gt; 0"> and ad.project_id=#{projectId}</if>
<if test="deptId &gt; 0 ">AND sp.deptid = #{deptId}</if>
<if test='proType != null and proType != "" and proType != "0"'> and sp.projectType = #{proType}</if>
@ -592,6 +592,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT ssp.infotype,COUNT(1) id FROM smz_ssp_problemmodify ssp
left join sur_project sp on sp.id=ssp.projectId
WHERE ssp.isDel=0 and ssp.infoType=#{infoType}
and sp.progressVisible=0 and sp.isDel=0
<if test="projectId > 0"> and ssp.projectId=#{projectId}</if>
<if test="deptId > 0 ">AND sp.deptid = #{deptId}</if>
<if test='proType != null and proType != "" and proType != "0"'> and sp.projectType = #{proType}</if>
@ -611,7 +612,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select * from (
SELECT ssp.infotype,COUNT(1) as total FROM smz_ssp_problemmodify ssp
left join sur_project sp on sp.id=ssp.projectId
WHERE ssp.isDel=0
WHERE ssp.isDel=0 and sp.progressVisible=0 and sp.isDel=0
<if test="projectId > 0"> and ssp.projectId=#{projectId}</if>
<if test="deptId > 0 ">AND sp.deptid = #{deptId}</if>
<if test='proType != null and proType != "" and proType != "0"'> and sp.projectType = #{proType}</if>
@ -629,7 +630,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
UNION ALL
select '96' as infotype,count(1) as total from dev_ai_project_data ad
left join sur_project sp on ad.project_id=sp.id
where 1=1
where sp.progressVisible=0 and sp.isDel=0
<if test="projectId &gt; 0"> and ad.project_id=#{projectId}</if>
<if test="deptId &gt; 0 ">AND sp.deptid = #{deptId}</if>
<if test='proType != null and proType != "" and proType != "0"'> and sp.projectType = #{proType}</if>
@ -646,7 +647,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="groupByInfotypeCheckState" parameterType="SmzSspProblemmodifyWhere" resultMap="SmzSspProblemmodifyResult">
SELECT ssp.infotype,ssp.checkState,COUNT(1) id FROM smz_ssp_problemmodify ssp
left join sur_project sp on sp.id=ssp.projectId
WHERE isDel=0
WHERE ssp.isDel=0 and sp.progressVisible=0 and sp.isDel=0
<if test="infoType !=null">and ssp.infoType=#{infoType}</if>
<if test="roleType !=null and roleType>0">and ssp.roleType=#{roleType}</if>
<if test="startDate!=null">and DATE(ssp.createtime) &gt;= DATE(#{startDate})</if>
@ -667,7 +668,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT p.infotype,p.checkState,COUNT(1) as total
FROM smz_ssp_problemmodify p
left join sur_project sp on p.projectId=sp.id
WHERE p.isDel=0
WHERE p.isDel=0 and sp.progressVisible=0 and sp.isDel=0
<if test="projectId &gt; 0"> and p.projectId=#{projectId}</if>
<if test="deptId >0 ">AND sp.deptid = #{deptId}</if>
<if test='proType != null and proType != "" and proType != "0"'> and sp.projectType = #{proType}</if>
@ -681,7 +682,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
UNION ALL
select '96' as infotype,'4' as checkState,count(1) as total from dev_ai_project_data ad
left join sur_project sp on ad.project_id=sp.id
where 1=1
where sp.progressVisible=0 and sp.isDel=0
<if test="projectId &gt; 0"> and ad.project_id=#{projectId}</if>
<if test="deptId &gt; 0 ">AND sp.deptid = #{deptId}</if>
<if test='proType != null and proType != "" and proType != "0"'> and sp.projectType = #{proType}</if>
@ -698,7 +699,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select count(1) cnt
FROM smz_ssp_problemmodify ssp
left join sur_project sp on p.projectId=sp.id
WHERE ssp.isDel=0
WHERE ssp.isDel=0 and sp.progressVisible=0 and sp.isDel=0
<if test="infoType !=null">and ssp.infoType=#{infoType}</if>
<if test="roleType !=null and roleType>0">and ssp.roleType=#{roleType}</if>
<if test="startDate!=null">and DATE(ssp.createtime) &gt;= DATE(#{startDate})</if>