update code

dev_xds
haha 2023-11-06 00:02:19 +08:00
parent c470afad2a
commit 423d77a86c
10 changed files with 73 additions and 1 deletions

View File

@ -36,4 +36,19 @@ public class ProjectPhotographyController extends BaseController {
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return AjaxResult.success(list);
}
@GetMapping("/selectLastPhotography")
public AjaxResult getLast(long projectId){
SurProjectPhotography where =new SurProjectPhotography();
where.setProjectId(projectId);
where.setIsDel(0l);
String key="bgscreen_selectLastPhotography_listPhotography_"+where.getProjectId();
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);
}
List<SurProjectPhotography> list=photographyService.selectLastPhotography(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return AjaxResult.success(list);
}
}

View File

@ -4,6 +4,7 @@ import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDictData;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.SecurityUtils;
import com.yanzhu.jh.project.domain.SurProjectStandard;
@ -38,6 +39,20 @@ public class ProjectStandardController extends BaseController {
return AjaxResult.success(list);
}
@PostMapping("/selectList")
public TableDataInfo selectList(@RequestBody SurProjectStandard where){
startPage();
Long deptId= where.getDeptId();
if(deptId==null || deptId<=0){
if (SecurityUtils.isUserB()) {
where.setPrjIds(getProjectIds());
}
}
List<SurProjectStandard> list=standardService.selectList(where);
return getDataTable(list);
}
@PostMapping("/groupByType")
public AjaxResult groupByType(@RequestBody SurProjectStandard where){

View File

@ -63,5 +63,7 @@ public interface SurProjectStandardMapper
public List<SysDictData> groupByType(SurProjectStandard where);
List<SurProjectStandard> groupByProject();
public List<SurProjectStandard> groupByProject();
public List<SurProjectStandard> selectList(SurProjectStandard where);
}

View File

@ -66,4 +66,6 @@ public interface ISurProjectStandardService
public List<SysDictData> groupByType(SurProjectStandard where);
public List<SurProjectStandard> groupByProject();
public List<SurProjectStandard> selectList(SurProjectStandard where);
}

View File

@ -123,4 +123,9 @@ public class SurProjectStandardServiceImpl implements ISurProjectStandardService
public List<SurProjectStandard> groupByProject() {
return surProjectStandardMapper.groupByProject();
}
@Override
public List<SurProjectStandard> selectList(SurProjectStandard where) {
return surProjectStandardMapper.selectList(where);
}
}

View File

@ -58,4 +58,6 @@ public interface SurProjectPhotographyMapper
* @return
*/
public int deleteSurProjectPhotographyByIds(Long[] ids);
public List<SurProjectPhotography> selectLastPhotography(SurProjectPhotography where);
}

View File

@ -58,4 +58,6 @@ public interface ISurProjectPhotographyService
* @return
*/
public int deleteSurProjectPhotographyById(Long id);
public List<SurProjectPhotography> selectLastPhotography(SurProjectPhotography where);
}

View File

@ -92,4 +92,9 @@ public class SurProjectPhotographyServiceImpl implements ISurProjectPhotographyS
{
return surProjectPhotographyMapper.deleteSurProjectPhotographyById(id);
}
@Override
public List<SurProjectPhotography> selectLastPhotography(SurProjectPhotography where) {
return surProjectPhotographyMapper.selectLastPhotography(where);
}
}

View File

@ -128,4 +128,19 @@
order by a.cnt desc
</select>
<select id="selectList" parameterType="SurProjectStandard" resultMap="SurProjectStandardResult">
<include refid="selectSurProjectStandardVo"/>
where is_del =0
<if test="projectId!=null and projectId>0"> and project_id=#{projectId}</if>
<if test="deptId!=null and deptId>0">
and project_id in (SELECT id FROM sur_project WHERE deptid= #{deptId})
</if>
<if test="prjIds !=null and prjIds.size()>0">
and project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="standardType!=null and standardType>0"> and standard_type=#{standardType}</if>
</select>
</mapper>

View File

@ -42,6 +42,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectSurProjectPhotographyVo"/>
where id = #{id}
</select>
<select id="selectLastPhotography" parameterType="SurProjectPhotography" resultMap="SurProjectPhotographyResult">
<include refid="selectSurProjectPhotographyVo"/>
<where>
<if test="projectId != null "> and project_id = #{projectId}</if>
<if test="isDel != null "> and is_del = #{isDel}</if>
</where>
ORDER BY video_date DESC LIMIT 0,1
</select>
<insert id="insertSurProjectPhotography" parameterType="SurProjectPhotography" useGeneratedKeys="true" keyProperty="id">
insert into sur_project_photography