|
@@ -75,11 +75,35 @@
|
|
|
left join sys_relation_person srp on srp.agency_leader_id=sal.user_id
|
|
left join sys_relation_person srp on srp.agency_leader_id=sal.user_id
|
|
|
where srp.type = 0 and srp.suggest_id = #{userId}
|
|
where srp.type = 0 and srp.suggest_id = #{userId}
|
|
|
</select>
|
|
</select>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ <select id="queryDeptByTimes" resultType="com.ydtech.modules.admin.model.vo.CountUserNumVo">
|
|
|
|
|
+ select spa.time, COUNT(spa.user_id) as countNum
|
|
|
|
|
+ from(
|
|
|
|
|
+ SELECT
|
|
|
|
|
+ s.user_id,DATE_FORMAT(s.create_time, '%Y-%m-%d %H' ) as time
|
|
|
|
|
+ FROM sys_user s
|
|
|
|
|
+ <where>
|
|
|
|
|
+ s.type = 3 and s.status in (1, 4, 5, 6, 7)
|
|
|
|
|
+ <if test="userId != null ">
|
|
|
|
|
+ and s.referrer_id = #{userId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="dto.beginTime != null and dto.beginTime != '' and dto.endTime != null and dto.endTime != ''">
|
|
|
|
|
+ and (DATE_FORMAT(s.create_time, '%Y-%m-%d' ) like CONCAT( DATE_FORMAT( #{dto.startTime}, '%Y-%m-%d' ), '%' ))
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ ) as spa
|
|
|
|
|
+ GROUP BY
|
|
|
|
|
+ spa.time
|
|
|
|
|
+ ORDER BY
|
|
|
|
|
+ spa.time ASC
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
<select id="queryDeptByTime" resultType="com.ydtech.modules.admin.model.vo.CountUserNumVo">
|
|
<select id="queryDeptByTime" resultType="com.ydtech.modules.admin.model.vo.CountUserNumVo">
|
|
|
select spa.time, COUNT(spa.user_id) as countNum
|
|
select spa.time, COUNT(spa.user_id) as countNum
|
|
|
from(
|
|
from(
|
|
|
SELECT
|
|
SELECT
|
|
|
- s.user_id,DATE_FORMAT(s.operation_time, '%Y-%m-%d' ) as time
|
|
|
|
|
|
|
+ s.user_id,DATE_FORMAT(s.create_time, '%Y-%m-%d' ) as time
|
|
|
FROM sys_user s
|
|
FROM sys_user s
|
|
|
<where>
|
|
<where>
|
|
|
s.type = 3 and s.status in (1, 4, 5, 6, 7)
|
|
s.type = 3 and s.status in (1, 4, 5, 6, 7)
|
|
@@ -96,11 +120,38 @@
|
|
|
ORDER BY
|
|
ORDER BY
|
|
|
spa.time ASC
|
|
spa.time ASC
|
|
|
</select>
|
|
</select>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="queryUserByTimes" resultType="com.ydtech.modules.admin.model.vo.CountUserNumVo">
|
|
|
|
|
+ select spa.time, COUNT(spa.user_id) as countNum
|
|
|
|
|
+ from(
|
|
|
|
|
+ SELECT
|
|
|
|
|
+ s.user_id,DATE_FORMAT(s.create_time, '%Y-%m-%d %H' ) as time
|
|
|
|
|
+ FROM sys_user s
|
|
|
|
|
+ <where>
|
|
|
|
|
+ s.status in (1, 4, 5, 6, 7)
|
|
|
|
|
+ <if test="deptIds != null and deptIds != '' and deptIds.size() > 0">
|
|
|
|
|
+ AND s.dept_id in
|
|
|
|
|
+ <foreach collection="deptIds" item="deptId" open="(" separator="," close=")">
|
|
|
|
|
+ #{deptId}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="dto.beginTime != null and dto.beginTime != '' and dto.endTime != null and dto.endTime != ''">
|
|
|
|
|
+ and (DATE_FORMAT(s.create_time, '%Y-%m-%d' ) like CONCAT( DATE_FORMAT( #{dto.startTime}, '%Y-%m-%d' ), '%' ))
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ ) as spa
|
|
|
|
|
+ GROUP BY
|
|
|
|
|
+ spa.time
|
|
|
|
|
+ ORDER BY
|
|
|
|
|
+ spa.time ASC
|
|
|
|
|
+
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
<select id="queryUserByTime" resultType="com.ydtech.modules.admin.model.vo.CountUserNumVo">
|
|
<select id="queryUserByTime" resultType="com.ydtech.modules.admin.model.vo.CountUserNumVo">
|
|
|
select spa.time, COUNT(spa.user_id) as countNum
|
|
select spa.time, COUNT(spa.user_id) as countNum
|
|
|
from(
|
|
from(
|
|
|
SELECT
|
|
SELECT
|
|
|
- s.user_id,DATE_FORMAT(s.operation_time, '%Y-%m-%d' ) as time
|
|
|
|
|
|
|
+ s.user_id,DATE_FORMAT(s.create_time, '%Y-%m-%d' ) as time
|
|
|
FROM sys_user s
|
|
FROM sys_user s
|
|
|
<where>
|
|
<where>
|
|
|
s.status in (1, 4, 5, 6, 7)
|
|
s.status in (1, 4, 5, 6, 7)
|