|
@@ -378,15 +378,52 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="canteenDiningRecordCompanyDetail" parameterType="hashmap" resultType="hashmap">
|
|
|
- <![CDATA[
|
|
|
SELECT a.id_,c.name_ as companyName,a.name_,a.job_number,count(b.person_id) as personNum,
|
|
|
- (SELECT count(*) FROM base_canteen_dining_record z WHERE z.person_id = a.id_ and z.del_flag=FALSE and z.category_='2') as 'lunch',
|
|
|
- (SELECT count(*) FROM base_canteen_dining_record z WHERE z.person_id = a.id_ and z.del_flag=FALSE and z.category_='3') as 'supper',
|
|
|
- (SELECT count(*) FROM base_canteen_dining_record z WHERE z.person_id = a.id_ and z.del_flag=FALSE and z.category_='4') as 'nightSnack'
|
|
|
+ (
|
|
|
+ SELECT count(*) FROM base_canteen_dining_record z
|
|
|
+ WHERE z.person_id = a.id_ and z.del_flag=FALSE and z.category_='2'
|
|
|
+ <if test="searchParams.beginTime != null">
|
|
|
+ <![CDATA[
|
|
|
+ and z.record_time >= #{searchParams.beginTime}
|
|
|
+ ]]>
|
|
|
+ </if>
|
|
|
+ <if test="searchParams.endTime != null">
|
|
|
+ <![CDATA[
|
|
|
+ and z.record_time <= #{searchParams.endTime}
|
|
|
+ ]]>
|
|
|
+ </if>
|
|
|
+ ) as 'lunch',
|
|
|
+ (
|
|
|
+ SELECT count(*) FROM base_canteen_dining_record z
|
|
|
+ WHERE z.person_id = a.id_ and z.del_flag=FALSE and z.category_='3'
|
|
|
+ <if test="searchParams.beginTime != null">
|
|
|
+ <![CDATA[
|
|
|
+ and z.record_time >= #{searchParams.beginTime}
|
|
|
+ ]]>
|
|
|
+ </if>
|
|
|
+ <if test="searchParams.endTime != null">
|
|
|
+ <![CDATA[
|
|
|
+ and z.record_time <= #{searchParams.endTime}
|
|
|
+ ]]>
|
|
|
+ </if>
|
|
|
+ ) as 'supper',
|
|
|
+ (
|
|
|
+ SELECT count(*) FROM base_canteen_dining_record z
|
|
|
+ WHERE z.person_id = a.id_ and z.del_flag=FALSE and z.category_='4'
|
|
|
+ <if test="searchParams.beginTime != null">
|
|
|
+ <![CDATA[
|
|
|
+ and z.record_time >= #{searchParams.beginTime}
|
|
|
+ ]]>
|
|
|
+ </if>
|
|
|
+ <if test="searchParams.endTime != null">
|
|
|
+ <![CDATA[
|
|
|
+ and z.record_time <= #{searchParams.endTime}
|
|
|
+ ]]>
|
|
|
+ </if>
|
|
|
+ ) as 'nightSnack'
|
|
|
FROM base_person_info a
|
|
|
left join base_canteen_dining_record b on a.id_=b.person_id
|
|
|
left join base_company_info c on a.company_id = c.id_
|
|
|
- ]]>
|
|
|
<where>
|
|
|
a.del_flag = false and b.del_flag = false
|
|
|
<if test="searchParams.companyId != null">
|
|
@@ -411,9 +448,6 @@
|
|
|
</foreach>
|
|
|
</select>
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
<select id="canteenDiningRecordDetail" parameterType="hashmap" resultType="hashmap">
|
|
|
<![CDATA[
|
|
|
SELECT * FROM base_canteen_dining_record x WHERE x.del_flag = false and x.device_no in
|