|
@@ -440,8 +440,8 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="canteenHqPersonList" parameterType="hashmap" resultType="hashmap">
|
|
|
- SELECT a.person_id as personId,b.job_number as jobNumber,b.name_ as personName,IFNULL(c.full_name, c.name_) as companyName,
|
|
|
- (SELECT count(id_) FROM base_canteen_dining_record z WHERE z.person_id=a.person_id and z.del_flag=FALSE and z.category_='2'
|
|
|
+ SELECT a.id_ as personId,a.job_number as jobNumber,a.name_ as personName,IFNULL(b.full_name, b.name_) as companyName,
|
|
|
+ (SELECT count(id_) 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}
|
|
@@ -453,7 +453,7 @@
|
|
|
]]>
|
|
|
</if>
|
|
|
) as 'lunch',
|
|
|
- (SELECT count(id_) FROM base_canteen_dining_record z WHERE z.person_id=a.person_id and z.del_flag=FALSE and z.category_='3'
|
|
|
+ (SELECT count(id_) 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}
|
|
@@ -465,7 +465,7 @@
|
|
|
]]>
|
|
|
</if>
|
|
|
) as 'supper',
|
|
|
- (SELECT count(id_) FROM base_canteen_dining_record z WHERE z.person_id=a.person_id and z.del_flag=FALSE and z.category_='4'
|
|
|
+ (SELECT count(id_) 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}
|
|
@@ -477,7 +477,7 @@
|
|
|
]]>
|
|
|
</if>
|
|
|
) as 'nightSnack',
|
|
|
- (SELECT count(id_) FROM base_canteen_dining_record z WHERE z.person_id=a.person_id and z.del_flag=FALSE
|
|
|
+ (SELECT count(id_) FROM base_canteen_dining_record z WHERE z.person_id=a.id_ and z.del_flag=FALSE
|
|
|
<if test="searchParams.beginTime != null">
|
|
|
<![CDATA[
|
|
|
and z.record_time >= #{searchParams.beginTime}
|
|
@@ -489,7 +489,7 @@
|
|
|
]]>
|
|
|
</if>
|
|
|
) as 'personNum',
|
|
|
- (SELECT IFNULL(sum(z.category_amount), 0.0) FROM base_canteen_dining_record z WHERE z.person_id=a.person_id and z.del_flag=FALSE
|
|
|
+ (SELECT IFNULL(sum(z.category_amount), 0.0) FROM base_canteen_dining_record z WHERE z.person_id=a.id_ and z.del_flag=FALSE
|
|
|
<if test="searchParams.beginTime != null">
|
|
|
<![CDATA[
|
|
|
and z.record_time >= #{searchParams.beginTime}
|
|
@@ -501,17 +501,21 @@
|
|
|
]]>
|
|
|
</if>
|
|
|
) as 'totalFee'
|
|
|
- FROM base_hq_person a
|
|
|
- left join base_person_info b on a.person_id=b.id_
|
|
|
- left join base_company_info c on b.company_id=c.id_
|
|
|
+ FROM base_person_info a
|
|
|
+ left join base_company_info b on a.company_id=b.id_
|
|
|
<where>
|
|
|
- a.del_flag = FALSE and b.del_flag = FALSE and c.del_flag = FALSE
|
|
|
+ a.del_flag = FALSE and b.del_flag = FALSE
|
|
|
<if test='searchParams.companyCode!=null'>
|
|
|
- and c.code_ like #{searchParams.companyCode}
|
|
|
+ and b.code_ like #{searchParams.companyCode}
|
|
|
</if>
|
|
|
<if test="searchParams.hqStatus != null">
|
|
|
and a.hq_status = #{searchParams.hqStatus}
|
|
|
</if>
|
|
|
+ <if test="searchParams.querHq != null">
|
|
|
+ <![CDATA[
|
|
|
+ and a.hq_status <> '0' and a.hq_status is not null
|
|
|
+ ]]>
|
|
|
+ </if>
|
|
|
</where>
|
|
|
<foreach item="sort" collection="sortList" open="order by" separator=",">
|
|
|
${sort.name} ${sort.order}
|