Просмотр исходного кода

运营绩效功能,优化问题

zhaoxian 2 лет назад
Родитель
Сommit
dd9391f19b

+ 25 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/mapper/xml/SysUserMapper.xml

@@ -446,5 +446,30 @@
         AND frozen_time <=#{endDate}
         AND t3.media_id = #{mediaId}
         GROUP BY t1.user_id
+        UNION
+        SELECT
+        t1.user_id as 'userId',
+        t2.realname,
+        t.role_name as 'roleName',
+        t.role_code as 'roleCode',
+        frozen_time as 'quitTime'
+        FROM `sys_role` t
+        LEFT JOIN sys_user_role t1 ON t.id = t1.role_id
+        LEFT JOIN sys_user t2 ON t1.user_id = t2.id
+        LEFT JOIN ctop_transfer_account t4 ON t1.user_id = t4.transferor
+        LEFT JOIN ctop_user_allocation t3 ON t4.account_id = t3.account_id
+        WHERE t.role_code in
+        <foreach collection="roleCode" item="roleCode" separator="," open="(" close=")">
+            #{roleCode}
+        </foreach>
+        <if test="userId != null and userId != ''">
+            AND t1.user_id =#{userId}
+        </if>
+        AND t2.status= 2
+        AND frozen_time >=#{startDate}
+        AND frozen_time &lt;=#{endDate}
+        AND t3.media_id = #{mediaId}
+        GROUP BY t1.user_id
+
     </select>
 </mapper>