Merge branch 'dev' of http://62.234.3.186:3000/sxyanzhu/jhprjv2 into dev
commit
df83d6f43b
|
@ -0,0 +1,39 @@
|
||||||
|
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.SurProjectMaterialSeal;
|
||||||
|
import com.yanzhu.jh.project.service.ISurProjectMaterialSealService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
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/materialSeal")
|
||||||
|
public class ProjectMaterialSealController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
ISurProjectMaterialSealService materialSealService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RedisCache redisCache;
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/selectTop20")
|
||||||
|
public AjaxResult selectTop20(@RequestBody SurProjectMaterialSeal where){
|
||||||
|
String key="bgscreen_selectTop20_selectTop20_"+where.getDeptId()+"-"+where.getProjectId();
|
||||||
|
Object obj=redisCache.getCacheObject(key);
|
||||||
|
if(obj!=null){
|
||||||
|
return AjaxResult.success(obj);
|
||||||
|
}
|
||||||
|
List<SurProjectMaterialSeal> list=materialSealService.selectTop20(where);
|
||||||
|
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
|
||||||
|
return AjaxResult.success(list);
|
||||||
|
}
|
||||||
|
}
|
|
@ -58,4 +58,6 @@ public interface SurProjectMaterialSealMapper
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteSurProjectMaterialSealByIds(Long[] ids);
|
public int deleteSurProjectMaterialSealByIds(Long[] ids);
|
||||||
|
|
||||||
|
public List<SurProjectMaterialSeal> selectTop20(SurProjectMaterialSeal where);
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,4 +58,6 @@ public interface ISurProjectMaterialSealService
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteSurProjectMaterialSealById(Long id);
|
public int deleteSurProjectMaterialSealById(Long id);
|
||||||
|
|
||||||
|
public List<SurProjectMaterialSeal> selectTop20(SurProjectMaterialSeal where);
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,4 +100,9 @@ public class SurProjectMaterialSealServiceImpl implements ISurProjectMaterialSea
|
||||||
{
|
{
|
||||||
return surProjectMaterialSealMapper.deleteSurProjectMaterialSealById(id);
|
return surProjectMaterialSealMapper.deleteSurProjectMaterialSealById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SurProjectMaterialSeal> selectTop20(SurProjectMaterialSeal where) {
|
||||||
|
return surProjectMaterialSealMapper.selectTop20(where);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -142,4 +142,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
<select id="selectTop20" parameterType="SurProjectMaterialSeal" resultMap="SurProjectMaterialSealResult">
|
||||||
|
select spme.id, spme.project_id, spme.dept_id, spme.main_image, spme.image_urls, spme.material_name, spme.use_position, spme.contract_brand, spme.use_brand, spme.seal_date, spme.sign_files, spme.alteration_files, spme.is_del, spme.create_by, spme.create_time, spme.update_by, spme.update_time, spme.remark, sp.projectName, sd.dept_name
|
||||||
|
from (
|
||||||
|
select * from sur_project_material_seal spme
|
||||||
|
where if(spme.is_del is null,0,spme.is_del)=0
|
||||||
|
<if test="deptId!=null and deptId>0"> and spme.project_id in (SELECT id FROM sur_project WHERE deptid=#{deptId}) </if>
|
||||||
|
<if test="projectId!=null and projectId>0">and spme.project_id = #{projectId}</if>
|
||||||
|
) spme
|
||||||
|
left join sur_project sp on spme.project_id = sp.id
|
||||||
|
left join sys_dept sd on sd.dept_id = spme.dept_id
|
||||||
|
order by spme.create_time desc
|
||||||
|
LIMIT 0,20
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
Loading…
Reference in New Issue