zhangjinli 3 years ago
parent a5f55f01a3
commit 2af2924f3f

@ -35,14 +35,14 @@ public interface VideoMapper extends BaseMapper<Video> {
@Update("update video INNER JOIN task on task.id = video.taskId and taskId = #{taskId} set video.status = 1 WHERE video.status = 0 ") @Update("update video INNER JOIN task on task.id = video.taskId and taskId = #{taskId} set video.status = 1 WHERE video.status = 0 ")
void updStatusByTaskId(int taskId, LocalDateTime endTime); void updStatusByTaskId(int taskId, LocalDateTime endTime);
@Select("SELECT t1.*,t2.name as providerName,t3.departmentId as departmentId,t3.name as departmentName,t4.title as taskTitle,t5.account,t5.name as accountName,t5.tel as accountTel,t5.validImg as accountImg \n" + // @Select("SELECT t1.*,t2.name as providerName,t3.departmentId as departmentId,t3.name as departmentName,t4.title as taskTitle,t5.account,t5.name as accountName,t5.tel as accountTel,t5.validImg as accountImg \n" +
" from video as t1\n" + // " from video as t1\n" +
"LEFT JOIN user as t2 on t2.id = t1.userId\n" + // "LEFT JOIN user as t2 on t2.id = t1.userId\n" +
"LEFT JOIN qywxDepartment as t3 on t3.departmentId = t2.main_department\n" + // "LEFT JOIN qywxDepartment as t3 on t3.departmentId = t2.main_department\n" +
"LEFT JOIN task as t4 on t4.id = t1.taskId\n" + // "LEFT JOIN task as t4 on t4.id = t1.taskId\n" +
"LEFT JOIN userAccount as t5 on t1.userId = t5.userId and t1.type = t5.platform\n" + // "LEFT JOIN userAccount as t5 on t1.userId = t5.userId and t1.type = t5.platform\n" +
"${ew.customSqlSegment} " + // "${ew.customSqlSegment} " +
"ORDER BY updateAt DESC,creatAt DESC") // "ORDER BY updateAt DESC,creatAt DESC")
IPage<Map> pageList(IPage iPage, @Param("ew") Wrapper<Video> queryWrapper); IPage<Map> pageList(IPage iPage, @Param("ew") Wrapper<Video> queryWrapper);
@Select("SELECT IFNULL(sum(t1.playNum),0) as playNumSum,\n" + @Select("SELECT IFNULL(sum(t1.playNum),0) as playNumSum,\n" +

@ -22,7 +22,7 @@
</collection> </collection>
</resultMap> </resultMap>
<select id="listAll" resultMap="listAllMap"> <select id="listAll" resultMap="listAllMap">
select t1.*,t2.name as userName,t3.departmentId,t3.name as departmentName,t4.dpId,t4.department select t1.*,t2.name as userName,t3.departmentId,t3.name as departmentName,t4.departmentId as dpId,t4.department
from userAccount as t1 from userAccount as t1
left join user as t2 on t1.userId = t2.id left join user as t2 on t1.userId = t2.id
left join qywxDepartment as t3 on t2.main_department = t3.departmentId left join qywxDepartment as t3 on t2.main_department = t3.departmentId

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zh.project0512.mapper.UserMapper">
<resultMap id="UserDpListMap" type="java.util.Map" autoMapping="false">
<id property="id" column="id"/>
<result column="url" property="url"/>
<result column="type" property="type"/>
<result column="userId" property="userId"/>
<result column="taskId" property="taskId"/>
<result column="playNum" property="playNum"/>
<result column="commendNum" property="commendNum"/>
<result column="collectionNum" property="collectionNum"/>
<result column="commentNum" property="commentNum"/>
<result column="reSendNum" property="reSendNum"/>
<result column="recommendNum" property="recommendNum"/>
<result column="reason" property="reason"/>
<result column="effectResult" property="effectResult"/>
<result column="creatAt" property="creatAt"/>
<result column="updateAt" property="updateAt"/>
<result column="isSettled" property="isSettled"/>
<result column="settledAt" property="settledAt"/>
<result column="status" property="status"/>
<result column="providerName" property="providerName"/>
<result column="departmentId" property="departmentId"/>
<result column="departmentName" property="departmentName"/>
<result column="account" property="account"/>
<result column="accountName" property="accountName"/>
<result column="accountTel" property="accountTel"/>
<result column="accountImg" property="accountImg"/>
<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="userDpList" resultMap="UserDpListMap">
SELECT t1.*,t2.name as providerName,t3.departmentId as departmentId,t3.name as departmentName,t4.title as taskTitle,
t5.account,t5.name as accountName,t5.tel as accountTel,t5.validImg as accountImg,t6.departmentId as dpId,t6.department
from video as t1
LEFT JOIN user as t2 on t2.id = t1.userId
LEFT JOIN qywxDepartment as t3 on t3.departmentId = t2.main_department
LEFT JOIN task as t4 on t4.id = t1.taskId
LEFT JOIN userAccount as t5 on t1.userId = t5.userId and t1.type = t5.platform
left join (SELECT t.*,d.name as department from qywxDepartmentUserLink t left join qywxDepartment d on t.departmentId = d.departmentId) as t6 on t1.openid = t6.openid
${ew.customSqlSegment}
ORDER BY updateAt DESC,creatAt DESC
</select>
</mapper>
Loading…
Cancel
Save