|
@@ -344,22 +344,22 @@
|
|
a.uptown_name,
|
|
a.uptown_name,
|
|
CONCAT( d.ridgepole, d.unit ) AS unit,
|
|
CONCAT( d.ridgepole, d.unit ) AS unit,
|
|
e.doorplate,
|
|
e.doorplate,
|
|
- DATE_FORMAT( c.dateStr, '%Y-%m-%d %H:%i:%s' ) AS dateStr,
|
|
|
|
|
|
+ b.door_name as doorName,
|
|
|
|
+ DATE_FORMAT( c.date, '%Y-%m-%d %H:%i:%s' ) AS dateStr,
|
|
g.linkman,
|
|
g.linkman,
|
|
g.phone,
|
|
g.phone,
|
|
de.department_name AS departmentName
|
|
de.department_name AS departmentName
|
|
- FROM
|
|
|
|
- (select user_id,min(cast(date as datetime)) as dateStr
|
|
|
|
- from out_scan
|
|
|
|
- where uptown_id = #{uptownId} 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,cast(date as date)
|
|
|
|
- ) c
|
|
|
|
|
|
+ FROM out_scan c
|
|
|
|
+ inner join (select user_id,min(date) as dateStr
|
|
|
|
+ from out_scan
|
|
|
|
+ where uptown_id = #{uptownId} 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
|
|
INNER JOIN sys_user_role t ON c.user_id = t.user_id
|
|
AND role_id = 1
|
|
AND role_id = 1
|
|
INNER JOIN sys_uptown_home g ON g.house_id = t.property_id
|
|
INNER JOIN sys_uptown_home g ON g.house_id = t.property_id
|
|
@@ -367,7 +367,11 @@
|
|
INNER JOIN sys_uptown_house e ON e.house_id = t.property_id
|
|
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_unit d ON d.unit_id = e.unit_id
|
|
LEFT JOIN sys_department de ON de.department_id = e.department_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>
|
|
<where>
|
|
|
|
+ <if test="queryProperties != null and queryProperties != ''">
|
|
|
|
+ and b.door_name like concat('%',#{queryProperties},'%')
|
|
|
|
+ </if>
|
|
<if test="phone != null and phone != ''">
|
|
<if test="phone != null and phone != ''">
|
|
and (g.linkman like concat('%',#{phone},'%')
|
|
and (g.linkman like concat('%',#{phone},'%')
|
|
or g.phone = #{phone} )
|
|
or g.phone = #{phone} )
|
|
@@ -386,12 +390,13 @@
|
|
a.uptown_name,
|
|
a.uptown_name,
|
|
CONCAT( d.ridgepole, d.unit ) AS unit,
|
|
CONCAT( d.ridgepole, d.unit ) AS unit,
|
|
e.doorplate,
|
|
e.doorplate,
|
|
- DATE_FORMAT( c.dateStr, '%Y-%m-%d %H:%i:%s' ) AS dateStr,
|
|
|
|
|
|
+ b.door_name as doorName,
|
|
|
|
+ DATE_FORMAT( c.date, '%Y-%m-%d %H:%i:%s' ) AS dateStr,
|
|
g.linkman,
|
|
g.linkman,
|
|
g.phone,
|
|
g.phone,
|
|
de.department_name AS departmentName
|
|
de.department_name AS departmentName
|
|
- FROM
|
|
|
|
- (select user_id,min(cast(date as datetime)) as dateStr
|
|
|
|
|
|
+ FROM out_scan c
|
|
|
|
+ inner join (select user_id,min(date) as dateStr
|
|
from out_scan
|
|
from out_scan
|
|
where uptown_id = #{uptownId} and go_status = 1 and in_type = 1
|
|
where uptown_id = #{uptownId} and go_status = 1 and in_type = 1
|
|
<if test="dateSta != null and dateSta !=''">
|
|
<if test="dateSta != null and dateSta !=''">
|
|
@@ -400,8 +405,7 @@
|
|
<if test="dateEnd != null and dateEnd !=''">
|
|
<if test="dateEnd != null and dateEnd !=''">
|
|
and date < #{dateEnd}
|
|
and date < #{dateEnd}
|
|
</if>
|
|
</if>
|
|
- group by user_id,cast(date as date)
|
|
|
|
- ) c
|
|
|
|
|
|
+ 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
|
|
INNER JOIN sys_user_role t ON c.user_id = t.user_id
|
|
AND role_id = 1
|
|
AND role_id = 1
|
|
INNER JOIN sys_uptown_home g ON g.house_id = t.property_id
|
|
INNER JOIN sys_uptown_home g ON g.house_id = t.property_id
|
|
@@ -409,7 +413,11 @@
|
|
INNER JOIN sys_uptown_house e ON e.house_id = t.property_id
|
|
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_unit d ON d.unit_id = e.unit_id
|
|
LEFT JOIN sys_department de ON de.department_id = e.department_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>
|
|
<where>
|
|
|
|
+ <if test="queryProperties != null and queryProperties != ''">
|
|
|
|
+ and b.door_name like concat('%',#{queryProperties},'%')
|
|
|
|
+ </if>
|
|
<if test="phone != null and phone != ''">
|
|
<if test="phone != null and phone != ''">
|
|
and (g.linkman like concat('%',#{phone},'%')
|
|
and (g.linkman like concat('%',#{phone},'%')
|
|
or g.phone = #{phone} )
|
|
or g.phone = #{phone} )
|