Compare commits

..

2 Commits

Author SHA1 Message Date
176yunxuan
f29c016405 Merge remote-tracking branch 'origin/feature' into feature
Some checks failed
JslGroup/JslDeveloper/JSL_OrganizeInternalOA/pipeline/head There was a failure building this commit
2024-03-11 16:34:08 +08:00
176yunxuan
fbddeff093 优化项目标签和状态查询 2024-03-11 16:33:39 +08:00
4 changed files with 10 additions and 9 deletions

View File

@ -109,10 +109,10 @@ public class ProjectDAO {
log.info("\t> 执行 DAO 层 ProjectDAO.get 方法"); log.info("\t> 执行 DAO 层 ProjectDAO.get 方法");
log.info("\t\t> 从 MySQL 获取数据"); log.info("\t\t> 从 MySQL 获取数据");
if(isFinish != null){ if(isFinish != null){
return projectMapper.getByIsfinish(isFinish); return projectMapper.getByIsfinish(userId,isFinish);
} }
if(tags != null && !tags.isEmpty()){ if(tags != null && !tags.isEmpty()){
return projectMapper.getByTags(tags); return projectMapper.getByTags(userId,tags);
} }
if(listAll == 0) { if(listAll == 0) {
return projectMapper.get(userId); return projectMapper.get(userId);

View File

@ -43,15 +43,15 @@ public interface ProjectMapper {
//@Select("select * from organize_oa.oa_project where json_extract(tags,'$.tags')" + //@Select("select * from organize_oa.oa_project where json_extract(tags,'$.tags')" +
//"like concat('%',#{tags},'%')") //"like concat('%',#{tags},'%')")
@Select("select * from organize_oa.oa_project where is_finish=#{isFinish} and is_delete=false") @Select("select * from organize_oa.oa_project where is_finish=#{isFinish} and is_delete=false and principal_id =#{userId}")
List<ProjectDO>getByIsfinish(Integer isFinish); List<ProjectDO>getByIsfinish(Long userId,Integer isFinish);
List<ProjectDO>getByTags(List<String> tags); List<ProjectDO>getByTags(Long userId,List<String> tags);
@Select("select * from organize_oa.oa_project where is_delete=false and status =1") @Select("select * from organize_oa.oa_project where is_delete=false and status =1 and principal_id=#{userId}")
List<ProjectDO> get(Long userId); List<ProjectDO> get(Long userId);
@Select("select * from organize_oa.oa_project where status =1 and status=1") @Select("select * from organize_oa.oa_project where status =1 and status=1 and principal_id=#{userId}")
List<ProjectDO> get1(Long userId); List<ProjectDO> get1(Long userId);
@Select("select * from organize_oa.oa_project where name=#{name}") @Select("select * from organize_oa.oa_project where name=#{name}")

View File

@ -204,7 +204,8 @@ public class ProjectServiceImpl implements ProjectService {
List<ProjectDO> projectDOList = projectDAO.get(userId,listAll,tags,isFinish); List<ProjectDO> projectDOList = projectDAO.get(userId,listAll,tags,isFinish);
return ResultUtil.success(projectDOList); return ResultUtil.success(projectDOList);
}else { }else {
List<ProjectDO> projectDOList = projectDAO.get(userId,0,tags,isFinish); listAll = 0;
List<ProjectDO> projectDOList = projectDAO.get(userId,listAll,tags,isFinish);
return ResultUtil.success(projectDOList); return ResultUtil.success(projectDOList);
} }

View File

@ -51,7 +51,7 @@
select * from organize_oa.oa_project where select * from organize_oa.oa_project where
<foreach collection="tags" item="tag" separator=",'%') and json_extract(tags,'$.tags')like concat('%'," <foreach collection="tags" item="tag" separator=",'%') and json_extract(tags,'$.tags')like concat('%',"
open="json_extract(tags,'$.tags')like concat('%'," open="json_extract(tags,'$.tags')like concat('%',"
close=",'%') and is_delete=false"> close=",'%') and is_delete=false and principal_id=#{userId}">
#{tag} #{tag}
</foreach> </foreach>
</select> </select>