update code

dev_xds
haha 2023-08-23 00:03:39 +08:00
parent 75223b9f64
commit 4ed6580320
7 changed files with 80 additions and 4 deletions

View File

@ -1,6 +1,8 @@
package com.yanzhu.jh.bigscreen.web.controller;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.redis.RedisCache;
import com.yanzhu.jh.project.domain.SurProjectSchedule;
import com.yanzhu.jh.project.service.ISurProjectScheduleService;
import org.springframework.beans.factory.annotation.Autowired;
@ -8,16 +10,37 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.concurrent.TimeUnit;
@RestController
@RequestMapping("/bgscreen/schedule")
public class ProjectScheduleController {
@Autowired
private ISurProjectScheduleService isurProjectScheduleService;
@Autowired
private RedisCache redisCache;
@GetMapping("/projectConstructionProgress")
public AjaxResult getProjectConstructionProgress(Long projectId){
SurProjectSchedule surProjectSchedule= isurProjectScheduleService.getProjectConstructionProgress(projectId);
return AjaxResult.success(surProjectSchedule);
}
/**
*
* @param type
* @return
*/
@GetMapping("/selectByProjectType")
public AjaxResult selectByProjectType(Long type){
String key="bgscreen_schedule_selectByProjectType_"+type;
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);
}
List<SurProjectSchedule> list=isurProjectScheduleService.selectByProjectType(type);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return AjaxResult.success(list);
}
}

View File

@ -80,6 +80,16 @@ public class SurProjectSchedule extends BaseEntity
@Excel(name = "数据状态")
private Long isDel;
private SurProject surProject;
public SurProject getSurProject() {
return surProject;
}
public void setSurProject(SurProject surProject) {
this.surProject = surProject;
}
public void setId(Long id)
{
this.id = id;

View File

@ -60,4 +60,11 @@ public interface SurProjectScheduleMapper
* @return
*/
public int deleteSurProjectScheduleByIds(Long[] ids);
/**
*
* @param type
* @return
*/
public List<SurProjectSchedule> selectByProjectType(Long type);
}

View File

@ -59,4 +59,11 @@ public interface ISurProjectScheduleService
* @return
*/
public int deleteSurProjectScheduleById(Long id);
/**
*
* @param type
* @return
*/
public List<SurProjectSchedule> selectByProjectType(Long type);
}

View File

@ -15,7 +15,7 @@ import com.yanzhu.jh.project.service.ISurProjectScheduleService;
* @date 2023-07-29
*/
@Service
public class SurProjectScheduleServiceImpl implements ISurProjectScheduleService
public class SurProjectScheduleServiceImpl implements ISurProjectScheduleService
{
@Autowired
private SurProjectScheduleMapper surProjectScheduleMapper;
@ -99,4 +99,14 @@ public class SurProjectScheduleServiceImpl implements ISurProjectScheduleService
{
return surProjectScheduleMapper.deleteSurProjectScheduleById(id);
}
/**
*
* @param type
* @return
*/
@Override
public List<SurProjectSchedule> selectByProjectType(Long type) {
return surProjectScheduleMapper.selectByProjectType(type);
}
}

View File

@ -58,7 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>
<select id="currentListByDept" parameterType="SmzProjectQuarterlyAssess" resultMap="SmzProjectQuarterlyAssessResultToProject">
SELECT a.*,p.projectName,d.dept_name,d. paretProjectName,d.projectSchedule
SELECT a.*,p.projectName,d.dept_name,p.paretProjectName,p.projectSchedule
FROM smz_project_quarterly_assess a,sur_project p,sys_dept d
WHERE a.project_id IN
(SELECT id FROM sur_project

View File

@ -24,14 +24,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<association property="surProject" javaType="SurProject">
<result property="id" column="project_id" />
<result property="projectName" column="projectName"/>
<result property="projectSort" column="projectSort"/>
<result property="projectSchedule" column="projectSchedule"/>
</association>
</resultMap>
<sql id="selectSurProjectScheduleVo">
SELECT * from (
SELECT s.*,p.projectName
FROM sur_project_schedule AS s LEFT JOIN sur_project AS p ON s.project_id=p.id ) as a
</sql>
<select id="selectSurProjectScheduleList" parameterType="SurProjectSchedule" resultMap="SurProjectScheduleResult">
SELECT * from (
SELECT s.*,p.projectName
@ -162,4 +170,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<select id="selectByProjectType" parameterType="Long" resultMap="SurProjectScheduleResult">
select * from vw_sur_project_schedule
WHERE id IN (
SELECT MAX(id) FROM sur_project_schedule
WHERE project_id IN (
SELECT id FROM sur_project WHERE isdel=0 AND projecttype=#{type} ) AND IF(is_del IS NULL ,0,is_del)=0
GROUP BY project_id
)
order by projectSort
</select>
</mapper>