zhangjinli 3 years ago
parent 9023a6a414
commit ab4378908a

@ -372,6 +372,8 @@ public class TaskController {
if(task!=null) {
List rewardRulesList = rewardRuleService.listByTemplateId(task.getRewardRuleTemplateId());
res.put("rewardRuleList", rewardRulesList);
List departmentList = taskService.taskDepartment(task.getId());
res.put("departmentList",departmentList);
}
return Result.success(res);
}

@ -13,7 +13,7 @@ import java.util.Map;
/**
* <p>
* Mapper
* Mapper
* </p>
*
* @author zh
@ -22,10 +22,11 @@ import java.util.Map;
public interface TaskMapper extends BaseMapper<Task> {
@Insert("insert into task (title,subtitle,start,end) values (#{title},#{subtitle},#{start},#{end})")
int add(Task task);
@Select("<script>" +
"SELECT t1.id " +
"from task t1 " +
"WHERE t1.id "+
"WHERE t1.id " +
"<if test='tagIdList !=null and tagIdList.size()!=0'> " +
"and t1.id in (SELECT taskId from taskTag WHERE taskTag.tagId in " +
@ -39,12 +40,12 @@ public interface TaskMapper extends BaseMapper<Task> {
")" +
"</if>" +
"<if test='openid!=null'>"+
"<if test='openid!=null'>" +
"and IF((SELECT count(*)!=0 FROM taskDepartment WHERE taskId = t1.id)>0," +
"t1.id in (SELECT taskId from taskDepartment inner JOIN user on user.openid =#{openid} " +
"and user.main_department = taskDepartment.departmentId), " +
" 1=1)"+
"</if>"+
" 1=1)" +
"</if>" +
"<if test='ew != null'>" +
"<if test='ew.nonEmptyOfWhere'>" +
@ -55,9 +56,11 @@ public interface TaskMapper extends BaseMapper<Task> {
"ORDER BY t1.updateAt DESC,t1.creatAt DESC" +
"</script>")
IPage<Integer> idList(IPage iPage,String openid, List<Integer> tagIdList, List<Integer> brandIdList, @Param("ew") Wrapper<Reference> queryWrapper);
List<Map> list(String openid,List<Integer> list, List<Integer> tagIdList, List<Integer> brandIdList, @Param("ew") Wrapper<Reference> queryWrapper);
Task detailById(String openid,int id);
IPage<Integer> idList(IPage iPage, String openid, List<Integer> tagIdList, List<Integer> brandIdList, @Param("ew") Wrapper<Reference> queryWrapper);
List<Map> list(String openid, List<Integer> list, List<Integer> tagIdList, List<Integer> brandIdList, @Param("ew") Wrapper<Reference> queryWrapper);
Task detailById(String openid, int id);
@Select("SELECT SUM(t1.playNum) as playNumSum,SUM(t1.commendNum) as commendNumSum,\n" +
"SUM(t1.collectionNum) as collectionNumSum,SUM(t1.commentNum) as commentNumSum,\n" +
@ -67,6 +70,7 @@ public interface TaskMapper extends BaseMapper<Task> {
"LEFT JOIN qywxDepartment as t4 on t3.main_department = t4.departmentId " +
"${ew.customSqlSegment}")
JSONObject taskEffect(@Param("ew") Wrapper<Task> queryWrapper);
@Select("SELECT SUM(t1.playNum) as playNumSum,SUM(t1.commendNum) as commendNumSum,\n" +
"SUM(t1.collectionNum) as collectionNumSum,SUM(t1.commentNum) as commentNumSum,\n" +
"SUM(t1.reSendNum) as reSendNumSum,SUM(t1.recommendNum) as recommendNumSum,SUM(t1.effectResult) as effectResultSum,t1.userId,\n" +
@ -75,4 +79,7 @@ public interface TaskMapper extends BaseMapper<Task> {
"LEFT JOIN qywxDepartment as t4 on t3.main_department = t4.departmentId " +
"${ew.customSqlSegment}")
List<Map> taskEffectData(@Param("ew") Wrapper<Task> queryWrapper);
@Select("select t1.departmentId,t2.name as departmentName from taskDepartment t1 left join qywxDepartment t2 on t1.departmentId = t2.departmentId")
List<Map> taskDepartment(int taskId);
}

@ -26,4 +26,5 @@ public interface ITaskService extends IService<Task> {
Task detailById(String openid,int id);
JSONObject taskEffect(@Param("ew") Wrapper<Task> queryWrapper);
List<Map> taskEffectData(@Param("ew") Wrapper<Task> queryWrapper);
List<Map> taskDepartment(int taskId);
}

@ -46,4 +46,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements IT
public List<Map> taskEffectData(@Param("ew") Wrapper<Task> queryWrapper){
return taskMapper.taskEffectData(queryWrapper);
}
public List<Map> taskDepartment(int taskId){
return taskMapper.taskDepartment(taskId);
}
}

Loading…
Cancel
Save