|
|
@@ -75,11 +75,19 @@
|
|
|
hs.name as "subcontractorName",
|
|
|
hs.abbreviation as "abbreviation",
|
|
|
null as "cpSubcontractorName",
|
|
|
- null as "cpSubcontractorId"
|
|
|
+ null as "cpSubcontractorId",
|
|
|
+ hs.daily_limit AS "dailyLimit",
|
|
|
+ hs.monthly_limit AS "monthlyLimit",
|
|
|
+ hs.mode as "mode"
|
|
|
FROM hlw_company_subcontractor a
|
|
|
left join hlw_company_account ha on ha.company_id = a.company_id and ha.subcontractor_id = a.subcontractor_id
|
|
|
left join hlw_subcontractor hs on hs.id = a.subcontractor_id
|
|
|
- WHERE a.company_id = #{hlwCompanySubcontractor.companyId}
|
|
|
+ <where>
|
|
|
+ a.company_id = #{hlwCompanySubcontractor.companyId}
|
|
|
+ <if test="hlwCompanySubcontractor.subcontractorId!=null and hlwCompanySubcontractor.subcontractorId!=''">
|
|
|
+ and a.subcontractor_id=#{hlwCompanySubcontractor.subcontractorId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
union all
|
|
|
SELECT
|
|
|
b.id AS "id",
|
|
|
@@ -93,13 +101,21 @@
|
|
|
hcs.cp_name as "subcontractorName",
|
|
|
hsa.abbreviation as "abbreviation",
|
|
|
hsa.name as "cpSubcontractorName",
|
|
|
- hsa.id as "cpSubcontractorId"
|
|
|
+ hsa.id as "cpSubcontractorId",
|
|
|
+ hsa.daily_limit AS "dailyLimit",
|
|
|
+ hsa.monthly_limit AS "monthlyLimit",
|
|
|
+ hsa.mode as "mode"
|
|
|
FROM hlw_company_cp b
|
|
|
left join hlw_company_account ha on ha.company_id = b.company_id and ha.cp_id = b.cp_id
|
|
|
left join hlw_cp_setting hcs on hcs.id = b.cp_id
|
|
|
left join hlw_company_cp_subcontractor hccs on hccs.company_cp_id=b.id
|
|
|
left join hlw_subcontractor hsa on hsa.id=hccs.subcontractor_id
|
|
|
- WHERE b.company_id = #{hlwCompanySubcontractor.companyId}
|
|
|
+ <where>
|
|
|
+ b.company_id = #{hlwCompanySubcontractor.companyId}
|
|
|
+ <if test="hlwCompanySubcontractor.subcontractorId!=null and hlwCompanySubcontractor.subcontractorId!=''">
|
|
|
+ and hsa.id=#{hlwCompanySubcontractor.subcontractorId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
<if test="hlwCompanySubcontractor.repeatType!=null">
|
|
|
group by b.id
|
|
|
</if>
|