|
@@ -432,4 +432,47 @@
|
|
|
ORDER BY dateStr DESC
|
|
|
</select>
|
|
|
|
|
|
+ <select id="exClockCount" resultType="com.bofeng.entity.Clock">
|
|
|
+ select * from (
|
|
|
+ SELECT
|
|
|
+ CONCAT( d.ridgepole, d.unit ) AS unit,
|
|
|
+ de.department_name AS departmentName,
|
|
|
+ count(de.department_name) as clockCount
|
|
|
+ FROM out_scan c
|
|
|
+ inner join (select user_id,min(date) as dateStr
|
|
|
+ from out_scan
|
|
|
+ where uptown_id = 1238790987234 and go_status = 1 and in_type = 1
|
|
|
+ <if test="dateSta != null and dateSta !=''">
|
|
|
+ and date >= #{dateSta}
|
|
|
+ </if>
|
|
|
+ <if test="dateEnd != null and dateEnd !=''">
|
|
|
+ and date < #{dateEnd}
|
|
|
+ </if>
|
|
|
+ group by user_id)aa on aa.user_id = c.user_id and aa.dateStr = c.date and c.go_status = 1 and c.in_type = 1
|
|
|
+ INNER JOIN sys_user_role t ON c.user_id = t.user_id AND role_id = 1
|
|
|
+ INNER JOIN sys_uptown_house e ON e.house_id = t.property_id
|
|
|
+ INNER JOIN sys_uptown_unit d ON d.unit_id = e.unit_id
|
|
|
+ INNER JOIN sys_uptown_home g ON g.house_id = t.property_id
|
|
|
+ LEFT JOIN sys_department de ON de.department_id = e.department_id
|
|
|
+ inner join sys_uptown_door b on c.door_id = b.door_id
|
|
|
+ <where>
|
|
|
+ <if test="queryProperties != null and queryProperties != ''">
|
|
|
+ and b.door_name like concat('%',#{queryProperties},'%')
|
|
|
+ </if>
|
|
|
+ <if test="phone != null and phone != ''">
|
|
|
+ and (g.linkman like concat('%',#{phone},'%')
|
|
|
+ or g.phone = #{phone} )
|
|
|
+ </if>
|
|
|
+ <if test="unitId != null and unitId != ''">
|
|
|
+ and d.unit_id = #{unitId}
|
|
|
+ </if>
|
|
|
+ <if test="departmentId != null and departmentId != ''">
|
|
|
+ and de.department_id = #{departmentId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ group by de.department_name, d.ridgepole, d.unit,de.department_name
|
|
|
+ order by unit,de.department_name
|
|
|
+ ) bb where bb.departmentName is not null
|
|
|
+ </select>
|
|
|
+
|
|
|
</mapper>
|