update code

dev_xds
haha 2023-09-16 00:09:12 +08:00
parent 64f878f661
commit 713e55768f
12 changed files with 129 additions and 13 deletions

View File

@ -28,7 +28,7 @@ public class ProjectCheckDetectionController {
* @param where checkType deptId projectId
* @return
*/
@PostMapping("groupByCheckType")
@PostMapping("/groupByCheckType")
public AjaxResult groupByCheckType(@RequestBody SurProjectCheckDetection where){
String key="bgscreen_checkDetection_groupMeasureInfo_"+where.getCheckType()+"_"+where.getDeptId()+"_"+where.getProjectId();
Object obj=redisCache.getCacheObject(key);
@ -39,4 +39,15 @@ public class ProjectCheckDetectionController {
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return AjaxResult.success(list);
}
@PostMapping("/getList")
public AjaxResult getList(@RequestBody SurProjectCheckDetection where){
String key="bgscreen_getList_groupMeasureInfo_"+where.getCheckType()+"_"+where.getDeptId()+"_"+where.getProjectId();
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);
}
List<SurProjectCheckDetection> list=checkDetectionService.getList(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return AjaxResult.success(list);
}
}

View File

@ -26,15 +26,26 @@ public class ProjectMeasureController {
* @param where measureType deptId projectId
* @return
*/
@PostMapping("groupMeasureInfo")
@PostMapping("/groupMeasureInfo")
public AjaxResult groupMeasureInfo(@RequestBody SurProjectMeasure where){
String key="bgscreen_measure_groupMeasureInfo_"+where.getMeasureType()+"_"+where.getDeptId()+"_"+where.getProjectId();
//Object obj=redisCache.getCacheObject(key);
// if(obj!=null){
// return AjaxResult.success(obj);
// }
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);
}
List<SurProjectMeasure> list=measureService.groupMeasureInfo(where);
//redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return AjaxResult.success(list);
}
@PostMapping("/getList")
public AjaxResult getList(@RequestBody SurProjectMeasure where){
String key="bgscreen_measure_getList_"+where.getMeasureType()+"_"+where.getDeptId()+"_"+where.getProjectId();
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);
}
List<SurProjectMeasure> list=measureService.getList(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return AjaxResult.success(list);
}
}

View File

@ -97,7 +97,26 @@ public class SurProjectCheckDetection extends BaseEntity
private String projectName;
private String deptName;
public void setId(Long id)
private String createByName;
private String updateByName;
public String getCreateByName() {
return createByName;
}
public void setCreateByName(String createByName) {
this.createByName = createByName;
}
public String getUpdateByName() {
return updateByName;
}
public void setUpdateByName(String updateByName) {
this.updateByName = updateByName;
}
public void setId(Long id)
{
this.id = id;
}

View File

@ -89,8 +89,26 @@ public class SurProjectMeasure extends BaseEntity
private String deptName;
private String measureTypeName;
private String measureInfoName;
private String createByName;
private String updateByName;
public void setId(Long id)
public String getCreateByName() {
return createByName;
}
public void setCreateByName(String createByName) {
this.createByName = createByName;
}
public String getUpdateByName() {
return updateByName;
}
public void setUpdateByName(String updateByName) {
this.updateByName = updateByName;
}
public void setId(Long id)
{
this.id = id;
}

View File

@ -85,4 +85,5 @@ public interface SurProjectCheckDetectionMapper
*/
public List<Map<String,Object>> findGroupCountByProjectId(Long projectId);
public List<SurProjectCheckDetection> getList(SurProjectCheckDetection where);
}

View File

@ -70,4 +70,6 @@ public interface SurProjectMeasureMapper
public List<Map<String,Object>> findGroupCountByProjectId(Long projectId);
public List<SurProjectMeasure> groupMeasureInfo(SurProjectMeasure where);
public List<SurProjectMeasure> getList(SurProjectMeasure where);
}

View File

@ -84,4 +84,6 @@ public interface ISurProjectCheckDetectionService
* @return
*/
public List<Map<String,Object>> findGroupCountByProjectId(Long projectId);
public List<SurProjectCheckDetection> getList(SurProjectCheckDetection where);
}

View File

@ -70,4 +70,6 @@ public interface ISurProjectMeasureService
public List<Map<String,Object>> findGroupCountByProjectId(Long projectId);
public List<SurProjectMeasure> groupMeasureInfo(SurProjectMeasure where);
public List<SurProjectMeasure> getList(SurProjectMeasure where);
}

View File

@ -145,4 +145,9 @@ public class SurProjectCheckDetectionServiceImpl implements ISurProjectCheckDete
public List<Map<String,Object>> findGroupCountByProjectId(Long projectId){
return surProjectCheckDetectionMapper.findGroupCountByProjectId(projectId);
}
@Override
public List<SurProjectCheckDetection> getList(SurProjectCheckDetection where) {
return surProjectCheckDetectionMapper.getList(where);
}
}

View File

@ -118,4 +118,9 @@ public class SurProjectMeasureServiceImpl implements ISurProjectMeasureService
public List<SurProjectMeasure> groupMeasureInfo(SurProjectMeasure where) {
return surProjectMeasureMapper.groupMeasureInfo(where);
}
@Override
public List<SurProjectMeasure> getList(SurProjectMeasure where) {
return surProjectMeasureMapper.getList(where);
}
}

View File

@ -32,13 +32,18 @@ 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" />
<result property="createByName" column="create_by_name"/>
<result property="updateByName" column="update_by_name"/>
</resultMap>
<sql id="selectSurProjectCheckDetectionVo">
select spcd.id, spcd.project_id, sp.projectName, spcd.dept_id, sd.dept_name, spcd.check_type, sdd.dict_label as check_type_name, spcd.material_name, spcd.use_position, spcd.sample_num, spcd.qualified_flag, spcd.represen_num, spcd.sample_user, spcd.sample_user_name, spcd.witness_user, spcd.witness_user_name, spcd.laboratory_name, spcd.check_time, spcd.check_state, spcd.detection_result, spcd.detection_file, spcd.create_by, spcd.create_time, spcd.is_del, spcd.update_by, spcd.update_time, spcd.remark from sur_project_check_detection spcd
left join sur_project sp on spcd.project_id = sp.id
left join sys_dept sd on sd.dept_id = spcd.dept_id
left join sys_dict_data sdd on sdd.dict_type = 'check_detection_check_type' and sdd.dict_value = spcd.check_type
SELECT spcd.id, spcd.project_id, sp.projectName, spcd.dept_id, sd.dept_name, spcd.check_type, sdd.dict_label AS check_type_name, spcd.material_name, spcd.use_position, spcd.sample_num, spcd.qualified_flag, spcd.represen_num, spcd.sample_user, spcd.sample_user_name, spcd.witness_user, spcd.witness_user_name, spcd.laboratory_name, spcd.check_time, spcd.check_state, spcd.detection_result, spcd.detection_file, spcd.create_by, spcd.create_time, spcd.is_del, spcd.update_by, spcd.update_time, spcd.remark ,u1.nick_name create_by_name,u2.nick_name update_by_name
FROM sur_project_check_detection spcd
LEFT JOIN sur_project sp ON spcd.project_id = sp.id
LEFT JOIN sys_dept sd ON sd.dept_id = spcd.dept_id
LEFT JOIN sys_dict_data sdd ON sdd.dict_type = 'check_detection_check_type' AND sdd.dict_value = spcd.check_type
LEFT JOIN sys_user u1 ON spcd.create_by=u1.phonenumber
LEFT JOIN sys_user u2 ON spcd.update_by=u2.phonenumber
</sql>
<select id="selectSurProjectCheckDetectionList" parameterType="SurProjectCheckDetection" resultMap="SurProjectCheckDetectionResult">
@ -264,4 +269,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
</select>
<select id="getList" parameterType="SurProjectCheckDetection" resultMap="SurProjectCheckDetectionResult">
<include refid="selectSurProjectCheckDetectionVo"/>
WHERE spcd.is_del=0
<if test="checkType!=null and checkType>0">AND spcd.check_type= #{checkType}</if>
<if test="deptId !=null and deptId > 0 ">
and spcd.project_id IN (SELECT id FROM sur_project WHERE deptid=#{deptId})
</if>
<if test="projectId !=null and projectId > 0 ">
and spcd.project_id=#{projectId}
</if>
</select>
</mapper>

View File

@ -31,6 +31,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="remark" column="remark" />
<result property="measureTypeName" column="measure_type_name" />
<result property="measureInfoName" column="measure_info_name" />
<result property="createByName" column="create_by_name"/>
<result property="updateByName" column="update_by_name"/>
</resultMap>
<sql id="selectSurProjectMeasureVo">
@ -196,4 +198,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
) b
ON a.dict_value=b.measure_info
</select>
<select id="getList" parameterType="SurProjectMeasure" resultMap="SurProjectMeasureResult">
SELECT spm.id, spm.project_id, spm.dept_id, spm.main_image, spm.image_urls, spm.measure_type, sdd1.dict_label AS measure_type_name, spm.measure_position, spm.measure_info, sdd2.dict_label AS measure_info_name, spm.measure_time, spm.measure_point_position, spm.measure_result, spm.measure_files, spm.quality_user, spm.quality_user_name, spm.supervise_user, spm.supervise_user_name, spm.is_del, spm.create_by, spm.create_time, spm.update_by, spm.update_time, spm.remark, sp.projectName, sd.dept_name ,u1.nick_name create_by_name,u2.nick_name update_by_name
FROM sur_project_measure spm
LEFT JOIN sur_project sp ON spm.project_id = sp.id
LEFT JOIN sys_dept sd ON sd.dept_id = spm.dept_id
LEFT JOIN sys_dict_data sdd1 ON sdd1.dict_type = 'project_measure_type' AND sdd1.dict_value = spm.measure_type
LEFT JOIN sys_dict_data sdd2 ON sdd2.dict_type = 'project_measure_info_type' AND sdd2.dict_value = spm.measure_info
LEFT JOIN sys_user u1 ON spm.create_by=u1.phonenumber
LEFT JOIN sys_user u2 ON spm.update_by=u2.phonenumber
WHERE IF(spm.is_del IS NULL,0,spm.is_del)=0
<if test='measureType !=null and measureType !="0"'>
and spm.measure_type = #{measureType}
</if>
<if test="deptId !=null and deptId >0">
AND spm.project_id IN (SELECT id FROM sur_project WHERE deptid=#{deptId})
</if>
<if test="projectId !=null and projectId >0">
AND spm.project_id=#{projectId}
</if>
</select>
</mapper>