package com.zh.project0512.mapper; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.zh.project0512.model.Reference; import com.zh.project0512.model.Task; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.*; import java.util.List; import java.util.Map; /** *

* Mapper 接口 *

* * @author zh * @since 2022-05-21 */ public interface TaskMapper extends BaseMapper { @Insert("insert into task (title,subtitle,start,end) values (#{title},#{subtitle},#{start},#{end})") int add(Task task); @Select("") IPage idList(IPage iPage, String openid, List tagIdList, List brandIdList, @Param("ew") Wrapper queryWrapper); List list(String openid, List list, List tagIdList, List brandIdList, @Param("ew") Wrapper 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" + "SUM(t1.reSendNum) as reSendNumSum,SUM(t1.recommendNum) as recommendNumSum,SUM(t1.effectResult) as effectResultSum,t1.userId,\n" + "t2.title as taskTitle from video as t1 INNER JOIN task as t2 on t2.id = 31 and t2.id = t1.taskId\n" + "LEFT JOIN user as t3 on t1.userId = t3.id\n" + "LEFT JOIN qywxDepartment as t4 on t3.main_department = t4.departmentId " + "${ew.customSqlSegment}") JSONObject taskEffect(@Param("ew") Wrapper 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" + "t2.title as taskTitle,t3.name as userName,t4.name as departmentName from video as t1 INNER JOIN task as t2 on t2.id = 31 and t2.id = t1.taskId\n" + "LEFT JOIN user as t3 on t1.userId = t3.id\n" + "LEFT JOIN qywxDepartment as t4 on t3.main_department = t4.departmentId " + "${ew.customSqlSegment}") List taskEffectData(@Param("ew") Wrapper queryWrapper); @Select("select t1.departmentId,t2.name as departmentName from taskDepartment t1 left join qywxDepartment t2 on t1.departmentId = t2.departmentId") List taskDepartment(int taskId); }