游客查询标签状态
This commit is contained in:
parent
6e4f22170d
commit
e19630f9cc
@ -46,9 +46,11 @@ public class ProjectController {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping("/project/get/custom")
|
@GetMapping("/project/get/custom")
|
||||||
public BaseResponse projectGetCustom(@RequestParam(required = false) Integer id){
|
public BaseResponse projectGetCustom(@RequestParam(required = false) Integer id,
|
||||||
|
@RequestParam(required = false) List<String> tags,
|
||||||
|
@RequestParam(required = false) Integer isFinish){
|
||||||
log.info("请求接口[GET]: /project/all/get");
|
log.info("请求接口[GET]: /project/all/get");
|
||||||
return projectService.tget(id);
|
return projectService.tget(id,tags,isFinish);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -9,7 +9,6 @@ import com.jsl.oa.model.doData.ProjectWorkDO;
|
|||||||
import com.jsl.oa.model.doData.info.ProjectShowDO;
|
import com.jsl.oa.model.doData.info.ProjectShowDO;
|
||||||
import com.jsl.oa.model.voData.ProjectInfoVO;
|
import com.jsl.oa.model.voData.ProjectInfoVO;
|
||||||
import com.jsl.oa.model.voData.ProjectWorkVO;
|
import com.jsl.oa.model.voData.ProjectWorkVO;
|
||||||
import com.jsl.oa.utils.BaseResponse;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
@ -199,8 +198,14 @@ public class ProjectDAO {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public List<ProjectDO> tget(Integer id) {
|
public List<ProjectDO> tget(Integer id, List<String> tags, Integer isFinish) {
|
||||||
log.info("DAO层");
|
log.info("DAO层");
|
||||||
|
if(isFinish != null){
|
||||||
|
return projectMapper.tgetByIsfinish(isFinish);
|
||||||
|
}
|
||||||
|
if(tags != null && !tags.isEmpty()){
|
||||||
|
return projectMapper.tgetByTags(tags);
|
||||||
|
}
|
||||||
return projectMapper.tget(id);
|
return projectMapper.tget(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -98,4 +98,10 @@ public interface ProjectMapper {
|
|||||||
|
|
||||||
//@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")
|
||||||
List<ProjectDO> tget(Integer id);
|
List<ProjectDO> tget(Integer id);
|
||||||
|
|
||||||
|
@Select("select * from organize_oa.oa_project where is_finish=#{isFinish} and is_delete=false")
|
||||||
|
List<ProjectDO> tgetByIsfinish(Integer isFinish);
|
||||||
|
|
||||||
|
|
||||||
|
List<ProjectDO> tgetByTags(List<String> tags);
|
||||||
}
|
}
|
||||||
|
@ -43,5 +43,5 @@ public interface ProjectService {
|
|||||||
|
|
||||||
BaseResponse projecWorktAdd(HttpServletRequest request, ProjectWorkVO projectWorkVO);
|
BaseResponse projecWorktAdd(HttpServletRequest request, ProjectWorkVO projectWorkVO);
|
||||||
|
|
||||||
BaseResponse tget(Integer id);
|
BaseResponse tget(Integer id, List<String> tags, Integer isFinish);
|
||||||
}
|
}
|
||||||
|
@ -65,9 +65,21 @@ public class ProjectServiceImpl implements ProjectService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BaseResponse tget(Integer id) {
|
public BaseResponse tget(Integer id, List<String> tags, Integer isFinish) {
|
||||||
log.info("\t> 执行 Service 层 ProjectService.tget 方法");
|
log.info("\t> 执行 Service 层 ProjectService.tget 方法");
|
||||||
List<ProjectDO> projectDOList = projectDAO.tget(id);
|
|
||||||
|
//根据状态查询
|
||||||
|
if(isFinish != null){
|
||||||
|
List<ProjectDO> projectDOList = projectDAO.tget(id,tags,isFinish);
|
||||||
|
return ResultUtil.success(projectDOList);
|
||||||
|
}
|
||||||
|
//根据标签查询
|
||||||
|
if(tags != null && !tags.isEmpty()){
|
||||||
|
List<ProjectDO> projectDOList = projectDAO.tget(id,tags,isFinish);
|
||||||
|
return ResultUtil.success(projectDOList);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<ProjectDO> projectDOList = projectDAO.tget(id,tags,isFinish);
|
||||||
return ResultUtil.success(projectDOList);
|
return ResultUtil.success(projectDOList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,22 +48,21 @@
|
|||||||
</update>
|
</update>
|
||||||
|
|
||||||
<select id="getByTags" resultType="com.jsl.oa.model.doData.ProjectDO">
|
<select id="getByTags" resultType="com.jsl.oa.model.doData.ProjectDO">
|
||||||
select * from organize_oa.oa_project where
|
select * from organize_oa.oa_project where is_delete=false and principal_id=#{userId} and json_extract(tags,'$.tags') like concat
|
||||||
<foreach collection="tags" item="tag" separator=",'%') and json_extract(tags,'$.tags')like concat('%',"
|
<foreach collection="tags" item="tag" separator=",'%') or json_extract(tags,'$.tags') like concat('%',"
|
||||||
open="json_extract(tags,'$.tags')like concat('%',"
|
open="('%," close=",'%')">
|
||||||
close=",'%') and is_delete=false and principal_id=#{userId}">
|
|
||||||
#{tag}
|
#{tag}
|
||||||
</foreach>
|
</foreach>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="workgetByTags" resultType="com.jsl.oa.model.doData.ProjectWorkDO">
|
<select id="workgetByTags" resultType="com.jsl.oa.model.doData.ProjectWorkDO">
|
||||||
select * from organize_oa.oa_project_work where
|
select * from organize_oa.oa_project_work where is_delete=false and principal_id=#{userId} and json_extract(tags,'$.tags') like concat
|
||||||
<foreach collection="tags" item="tag" separator=",'%') and json_extract(tags,'$.tags')like concat('%',"
|
<foreach collection="tags" item="tag" separator=",'%') or json_extract(tags,'$.tags') like concat('%',"
|
||||||
open="json_extract(tags,'$.tags')like concat('%',"
|
open="('%'," close=",'%')">
|
||||||
close=",'%') and is_delete=false and principal_id=#{userId}">
|
|
||||||
#{tag}
|
#{tag}
|
||||||
</foreach>
|
</foreach>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="tget" resultType="com.jsl.oa.model.doData.ProjectDO">
|
<select id="tget" resultType="com.jsl.oa.model.doData.ProjectDO">
|
||||||
select * from organize_oa.oa_project where is_delete=false
|
select * from organize_oa.oa_project where is_delete=false
|
||||||
<if test="id != null">
|
<if test="id != null">
|
||||||
@ -71,4 +70,12 @@
|
|||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="tgetByTags" resultType="com.jsl.oa.model.doData.ProjectDO">
|
||||||
|
select * from organize_oa.oa_project where is_delete=false and json_extract(tags,'$.tags') like concat
|
||||||
|
<foreach collection="tags" item="tag" separator=",'%') or json_extract(tags,'$.tags') like concat('%',"
|
||||||
|
open="('%'," close=",'%')">
|
||||||
|
#{tag}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
Loading…
x
Reference in New Issue
Block a user