Compare commits
No commits in common. "df52d05759eeccd780497ed0935f87269f538f28" and "63667c527f48e13eb380316749e6ad15a1b8bc1f" have entirely different histories.
df52d05759
...
63667c527f
@ -42,11 +42,9 @@ public class ProjectController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/project/get/custom")
|
||||
public BaseResponse projectGetCustom(@RequestParam(required = false) Integer id,
|
||||
@RequestParam(required = false) List<String> tags,
|
||||
@RequestParam(required = false) List<Integer> isFinish){
|
||||
public BaseResponse projectGetCustom(@RequestParam(required = false) Integer id){
|
||||
log.info("请求接口[GET]: /project/all/get");
|
||||
return projectService.tget(id,tags,isFinish);
|
||||
return projectService.tget(id);
|
||||
}
|
||||
|
||||
|
||||
@ -58,7 +56,7 @@ public class ProjectController {
|
||||
@GetMapping("/project/get")
|
||||
public BaseResponse projectGet(@RequestParam(required = false) Integer listAll,
|
||||
@RequestParam(required = false) List<String> tags,
|
||||
@RequestParam(required = false) List<Integer> isFinish,
|
||||
@RequestParam(required = false) Integer isFinish,
|
||||
HttpServletRequest request) {
|
||||
log.info("请求接口[GET]: /project/get");
|
||||
return projectService.get(listAll,request,tags,isFinish);
|
||||
@ -72,7 +70,7 @@ public class ProjectController {
|
||||
@GetMapping("/project/work/get")
|
||||
public BaseResponse projectWorkGet(@RequestParam(required = false) Integer listAll,
|
||||
@RequestParam(required = false) List<String> tags,
|
||||
@RequestParam(required = false) List<Integer> isFinish,
|
||||
@RequestParam(required = false) Integer isFinish,
|
||||
HttpServletRequest request) {
|
||||
log.info("请求接口[GET]: /project/work/get");
|
||||
return projectService.workget(listAll, request, tags, isFinish);
|
||||
|
@ -119,10 +119,10 @@ public class ProjectDAO {
|
||||
return projectMapper.setProjectShow(setProjectShow);
|
||||
}
|
||||
|
||||
public List<ProjectDO> get(Long userId,Integer listAll,List<String> tags,List<Integer> isFinish) {
|
||||
public List<ProjectDO> get(Long userId,Integer listAll,List<String> tags,Integer isFinish) {
|
||||
log.info("\t> 执行 DAO 层 ProjectDAO.get 方法");
|
||||
log.info("\t\t> 从 MySQL 获取数据");
|
||||
if(isFinish != null && !isFinish.isEmpty()){
|
||||
if(isFinish != null){
|
||||
return projectMapper.getByIsfinish(userId,isFinish);
|
||||
}
|
||||
if(tags != null && !tags.isEmpty()){
|
||||
@ -135,10 +135,10 @@ public class ProjectDAO {
|
||||
}
|
||||
}
|
||||
|
||||
public List<ProjectWorkDO> workget(Long userId, Integer listAll, List<String> tags, List<Integer> isFinish) {
|
||||
public List<ProjectWorkDO> workget(Long userId, Integer listAll, List<String> tags, Integer isFinish) {
|
||||
log.info("\t> 执行 DAO 层 ProjectDAO.workget 方法");
|
||||
log.info("\t\t> 从 MySQL 获取数据");
|
||||
if(isFinish != null && !isFinish.isEmpty()){
|
||||
if(isFinish != null){
|
||||
return projectMapper.workgetByIsfinish(userId,isFinish);
|
||||
}
|
||||
if(tags != null && !tags.isEmpty()){
|
||||
@ -212,14 +212,11 @@ public class ProjectDAO {
|
||||
}
|
||||
|
||||
|
||||
public List<ProjectDO> tget(Integer id, List<Integer> isFinish, List<String> tags) {
|
||||
|
||||
public List<ProjectDO> tget(Integer id) {
|
||||
log.info("DAO层");
|
||||
if(isFinish != null && !isFinish.isEmpty()){
|
||||
return projectMapper.tgetByIsfinish(isFinish);
|
||||
}
|
||||
if(tags != null && !tags.isEmpty()){
|
||||
return projectMapper.tgetBytags(tags);
|
||||
}
|
||||
return projectMapper.tget(id);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -49,16 +49,15 @@ public interface ProjectMapper {
|
||||
|
||||
//@Select("select * from organize_oa.oa_project where json_extract(tags,'$.tags')" +
|
||||
//"like concat('%',#{tags},'%')")
|
||||
|
||||
//@Select("select * from organize_oa.oa_project where is_finish=#{isFinish} and is_delete=false and principal_id=#{userId}")
|
||||
List<ProjectDO>getByIsfinish(Long userId,List<Integer> isFinish);
|
||||
@Select("select * from organize_oa.oa_project where is_finish=#{isFinish} and is_delete=false and principal_id=#{userId}")
|
||||
List<ProjectDO>getByIsfinish(Long userId,Integer isFinish);
|
||||
|
||||
List<ProjectDO>getByTags(Long userId,List<String> tags);
|
||||
|
||||
@Select("select * from organize_oa.oa_project where is_delete=false and status=1 and principal_id=#{userId}")
|
||||
List<ProjectDO> get(Long userId);
|
||||
|
||||
@Select("select * from organize_oa.oa_project where status =1 and principal_id=#{userId}")
|
||||
@Select("select * from organize_oa.oa_project where status =1 and is_delete =true and principal_id=#{userId}")
|
||||
List<ProjectDO> get1(Long userId);
|
||||
|
||||
@Select("select * from organize_oa.oa_project where name=#{name}")
|
||||
@ -85,22 +84,17 @@ public interface ProjectMapper {
|
||||
@Update("UPDATE organize_oa.oa_project_user SET uid = #{uid} , updated_at = CURRENT_TIMESTAMP WHERE id = #{id}")
|
||||
boolean updateUserForProjectUser(Long uid, Long id);
|
||||
|
||||
|
||||
//@Select("select * from organize_oa.oa_project_work where is_finish=#{isFinish} and is_delete=false and principal_id =#{userId}")
|
||||
List<ProjectWorkDO> workgetByIsfinish(Long userId, List<Integer> isFinish);
|
||||
@Select("select * from organize_oa.oa_project_work where is_finish=#{isFinish} and is_delete=false and principal_id =#{userId}")
|
||||
List<ProjectWorkDO> workgetByIsfinish(Long userId, Integer isFinish);
|
||||
|
||||
List<ProjectWorkDO> workgetByTags(Long userId, List<String> tags);
|
||||
|
||||
@Select("select * from organize_oa.oa_project_work where is_delete=false and status =1 and principal_id=#{userId}")
|
||||
List<ProjectWorkDO> workget(Long userId);
|
||||
|
||||
@Select("select * from organize_oa.oa_project_work where status=1 and principal_id=#{userId}")
|
||||
@Select("select * from organize_oa.oa_project_work where is_delete =true and status=1 and principal_id=#{userId}")
|
||||
List<ProjectWorkDO> workget1(Long userId);
|
||||
|
||||
|
||||
//@Select("select * from organize_oa.oa_project where is_delete=false and status=1")
|
||||
List<ProjectDO> tget(Integer id);
|
||||
|
||||
List<ProjectDO> tgetByIsfinish(List<Integer> isFinish);
|
||||
|
||||
List<ProjectDO> tgetBytags(List<String> tags);
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ public interface ProjectService {
|
||||
|
||||
BaseResponse editHeader(HttpServletRequest request, ProjectShowVO projectShowVO, Integer id);
|
||||
|
||||
BaseResponse get(Integer listAll, HttpServletRequest request, List<String> tags, List<Integer> isFinish);
|
||||
BaseResponse get(Integer listAll, HttpServletRequest request, List<String> tags, Integer isFinish);
|
||||
|
||||
BaseResponse getByName(String name);
|
||||
|
||||
@ -36,9 +36,9 @@ public interface ProjectService {
|
||||
|
||||
BaseResponse projectToOtherUserForCutting(HttpServletRequest request, Long oldUid, Long pid, Long newUid);
|
||||
|
||||
BaseResponse workget(Integer listAll, HttpServletRequest request, List<String> tags, List<Integer> isFinish);
|
||||
BaseResponse workget(Integer listAll, HttpServletRequest request, List<String> tags, Integer isFinish);
|
||||
|
||||
BaseResponse projecWorktAdd(HttpServletRequest request, ProjectWorkVO projectWorkVO);
|
||||
|
||||
BaseResponse tget(Integer id, List<String> tags, List<Integer> isFinish);
|
||||
BaseResponse tget(Integer id);
|
||||
}
|
||||
|
@ -61,20 +61,9 @@ public class ProjectServiceImpl implements ProjectService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse tget(Integer id, List<String> tags, List<Integer> isFinish) {
|
||||
public BaseResponse tget(Integer id) {
|
||||
log.info("\t> 执行 Service 层 ProjectService.tget 方法");
|
||||
//根据状态查询
|
||||
if (isFinish != null && !isFinish.isEmpty()) {
|
||||
List<ProjectDO> projectDOList = projectDAO.tget(id,isFinish,tags);
|
||||
return ResultUtil.success(projectDOList);
|
||||
}
|
||||
//根据标签查询
|
||||
if (tags != null && !tags.isEmpty()) {
|
||||
List<ProjectDO> projectDOList = projectDAO.tget(id,isFinish,tags);
|
||||
return ResultUtil.success(projectDOList);
|
||||
}
|
||||
|
||||
List<ProjectDO> projectDOList = projectDAO.tget(id,isFinish,tags);
|
||||
List<ProjectDO> projectDOList = projectDAO.tget(id);
|
||||
return ResultUtil.success(projectDOList);
|
||||
}
|
||||
|
||||
@ -214,13 +203,13 @@ public class ProjectServiceImpl implements ProjectService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse get(Integer listAll, HttpServletRequest request, List<String> tags, List<Integer> isFinish) {
|
||||
public BaseResponse get(Integer listAll, HttpServletRequest request, List<String> tags, Integer isFinish) {
|
||||
log.info("\t> 执行 Service 层 ProjectService.get 方法");
|
||||
|
||||
//获取用户
|
||||
Long userId = Processing.getAuthHeaderToUserId(request);
|
||||
//根据状态查询
|
||||
if (isFinish != null && !isFinish.isEmpty()) {
|
||||
if (isFinish != null) {
|
||||
List<ProjectDO> projectDOList = projectDAO.get(userId, listAll, tags, isFinish);
|
||||
return ResultUtil.success(projectDOList);
|
||||
}
|
||||
@ -243,13 +232,13 @@ public class ProjectServiceImpl implements ProjectService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse workget(Integer listAll, HttpServletRequest request, List<String> tags, List<Integer> isFinish) {
|
||||
public BaseResponse workget(Integer listAll, HttpServletRequest request, List<String> tags, Integer isFinish) {
|
||||
log.info("\t> 执行 Service 层 ProjectService.workget 方法");
|
||||
|
||||
//获取用户
|
||||
Long userId = Processing.getAuthHeaderToUserId(request);
|
||||
//根据状态查询
|
||||
if (isFinish != null && !isFinish.isEmpty()) {
|
||||
if (isFinish != null) {
|
||||
List<ProjectWorkDO> projectWorkDOList = projectDAO.workget(userId, listAll, tags, isFinish);
|
||||
return ResultUtil.success(projectWorkDOList);
|
||||
}
|
||||
|
@ -48,39 +48,22 @@
|
||||
</update>
|
||||
|
||||
<select id="getByTags" resultType="com.jsl.oa.model.doData.ProjectDO">
|
||||
select * from organize_oa.oa_project where is_delete=false and principal_id=#{userId} and
|
||||
<foreach collection="tags" item="tag" separator=",'%') or json_extract(tags,'$.tags')like concat('%',"
|
||||
select * from organize_oa.oa_project where
|
||||
<foreach collection="tags" item="tag" separator=",'%') and json_extract(tags,'$.tags')like concat('%',"
|
||||
open="json_extract(tags,'$.tags')like concat('%',"
|
||||
close=",'%')">
|
||||
close=",'%') and is_delete=false and principal_id=#{userId}">
|
||||
#{tag}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="getByIsfinish" resultType="com.jsl.oa.model.doData.ProjectDO">
|
||||
select * from organize_oa.oa_project where is_delete=false and principal_id =#{userId} and is_finish in
|
||||
<foreach collection="isFinish" item="Finish" separator="," open="(" close=")">
|
||||
#{Finish}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="workgetByTags" resultType="com.jsl.oa.model.doData.ProjectWorkDO">
|
||||
select * from organize_oa.oa_project_work where is_delete=false and principal_id=#{userId} and project_id in(
|
||||
select id from organize_oa.oa_project where
|
||||
<foreach collection="tags" item="tag" separator=",'%') or json_extract(tags,'$.tags')like concat('%',"
|
||||
select * from organize_oa.oa_project_work where
|
||||
<foreach collection="tags" item="tag" separator=",'%') and json_extract(tags,'$.tags')like concat('%',"
|
||||
open="json_extract(tags,'$.tags')like concat('%',"
|
||||
close=",'%'))">
|
||||
close=",'%') and is_delete=false and principal_id=#{userId}">
|
||||
#{tag}
|
||||
</foreach>
|
||||
|
||||
</select>
|
||||
|
||||
<select id="workgetByIsfinish" resultType="com.jsl.oa.model.doData.ProjectWorkDO">
|
||||
select * from organize_oa.oa_project_work where is_delete=false and principal_id =#{userId} and is_finish in
|
||||
<foreach collection="isFinish" item="Finish" separator="," open="(" close=")">
|
||||
#{Finish}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="tget" resultType="com.jsl.oa.model.doData.ProjectDO">
|
||||
select * from organize_oa.oa_project where is_delete=false
|
||||
<if test="id != null">
|
||||
@ -88,22 +71,4 @@
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="tgetBytags" resultType="com.jsl.oa.model.doData.ProjectDO">
|
||||
select * from organize_oa.oa_project where is_delete=false and
|
||||
<foreach collection="tags" item="tag" separator=",'%') or json_extract(tags,'$.tags')like concat('%',"
|
||||
open="json_extract(tags,'$.tags')like concat('%',"
|
||||
close=",'%')">
|
||||
#{tag}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="tgetByIsfinish" resultType="com.jsl.oa.model.doData.ProjectDO">
|
||||
select * from organize_oa.oa_project where is_delete=false and is_finish in
|
||||
<foreach collection="isFinish" item="Finish" separator="," open="(" close=")">
|
||||
#{Finish}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
</mapper>
|
Loading…
x
Reference in New Issue
Block a user