zhangjinli 3 years ago
parent e4b023e284
commit ce557ccaf5

@ -631,7 +631,9 @@ public class TaskController {
QueryWrapper<Task> qw = new QueryWrapper<>();
qw.eq("t2.id", param.getId()).groupBy("t1.userId");
qw.like(param.getUserName() != null, "t3.name", param.getUserName());
qw.like(param.getDepartmentName() != null, "t4.name", param.getDepartmentName());
// qw.like(param.getDepartmentName() != null, "t4.name", param.getDepartmentName());
qw.inSql(param.getDepartmentName() != null,"t3.openid",
"SELECT t1.openid from qywxDepartmentUserLink as t1 INNER JOIN qywxDepartment as t2 on t1.departmentId = t2.departmentId and t2.name like "+"'%"+param.getDepartmentName()+"%'");
if(null !=param.getBeginTime()){
qw.ge( "date_format(t1.creatAt, '%Y-%m-%d')", param.getBeginTime());
}

@ -94,4 +94,34 @@
WHERE t1.id =#{id}
</select>
<resultMap id="taskEffectMap" type="java.util.Map" autoMapping="false">
<id property="id" column="id"/>
<result column="playNumSum" property="playNumSum"/>
<result column="commendNumSum" property="commendNumSum"/>
<result column="collectionNumSum" property="collectionNumSum"/>
<result column="commentNumSum" property="commentNumSum"/>
<result column="reSendNumSum" property="reSendNumSum"/>
<result column="recommendNumSum" property="recommendNumSum"/>
<result column="effectResultSum" property="effectResultSum"/>
<result column="userId" property="userId"/>
<result column="taskTitle" property="taskTitle"/>
<result column="userName" property="userName"/>
<result column="departmentName" property="departmentName"/>
<collection property="departmentList" ofType="java.util.Map" javaType="java.util.List" autoMapping="false">
<id column="dpId" property="id"/>
<result column="department" property="departmentName"/>
</collection>
</resultMap>
<select id="taskEffectDataPage" resultMap="taskEffectMap">
SELECT IFNULL(SUM(t1.playNum),0) as playNumSum,IFNULL(SUM(t1.commendNum),0) as commendNumSum,
IFNULL(SUM(t1.collectionNum),0) as collectionNumSum,IFNULL(SUM(t1.commentNum),0) as commentNumSum,
IFNULL(SUM(t1.reSendNum),0) as reSendNumSum,IFNULL(SUM(t1.recommendNum),0) as recommendNumSum,
IFNULL(SUM(t1.effectResult),0) as effectResultSum,t1.userId,
t2.title as taskTitle,t3.name as userName,t4.name as departmentName,t5.departmentId as dpId,t5.department
from video as t1 INNER JOIN task as t2 on t2.id = t1.taskId
LEFT JOIN user as t3 on t1.userId = t3.id
LEFT JOIN qywxDepartment as t4 on t3.main_department = t4.departmentId
LEFT JOIN (SELECT t.*,d.name as department from qywxDepartmentUserLink t left join qywxDepartment d on t.departmentId = d.departmentId) as t5 on t3.openid = t5.openid
${ew.customSqlSegment}
</select>
</mapper>

Loading…
Cancel
Save