|
@@ -7,7 +7,7 @@
|
|
|
<result column="id" jdbcType="BIGINT" property="id"/>
|
|
|
<result column="company_id" jdbcType="BIGINT" property="companyId"/>
|
|
|
<association property="serviceName" select="getServiceName" column="company_id"></association>
|
|
|
- <association property="socialCreditCode" select="getSocialCreditCode" column="company_id"/>
|
|
|
+ <association property="socialCreditCode" select="getSocialCreditCode" column="company_id"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<!--带条件的List查询-->
|
|
@@ -22,13 +22,20 @@
|
|
|
|
|
|
<sql id="getListSql">
|
|
|
SELECT t1.*, t2.name as company_name,
|
|
|
- (select concat(bwor.year, '年', bwor.month, '月') from biz_work_order_record bwor where bwor.work_order_id = t1.work_order_id order by year desc, month desc limit 1) currentDate,
|
|
|
-<!-- (select concat(frtd.year, '-', frtd.month) from biz_housing_fund_confirm_detail frtd where frtd.housing_fund_confirm_id = t1.id order by year desc, month desc limit 1) currentDate, -->
|
|
|
+ (select concat(bwor.year, '年', bwor.month, '月') from biz_work_order_record bwor where bwor.work_order_id =
|
|
|
+ t1.work_order_id order by year desc, month desc limit 1) currentDate,
|
|
|
+ <!-- (select concat(frtd.year, '-', frtd.month) from biz_housing_fund_confirm_detail frtd where frtd.housing_fund_confirm_id = t1.id order by year desc, month desc limit 1) currentDate, -->
|
|
|
t2.tax_type,
|
|
|
- t3.account_name as from_company_name
|
|
|
+ t3.account_name as from_company_name, t5.verifier_id,
|
|
|
+ t6.nick_name as verifierName,
|
|
|
+ t5.verifier_time
|
|
|
FROM biz_housing_fund_confirm t1
|
|
|
left join biz_company t2 on t2.id = t1.company_id
|
|
|
left join biz_tenant t3 on t3.id = t1.tenant_id
|
|
|
+ left join biz_housing_fund_confirm_detail t5 on t5.housing_fund_confirm_id = t1.id
|
|
|
+ and t5.deleted = 0 and t5.month = #{month} and t5.year = #{year} and t5.housing_fund_confirm_id = t1.id
|
|
|
+ left join sys_user t6 on t6.user_id = t5.verifier_id
|
|
|
+
|
|
|
<trim prefix=" WHERE" suffix="" suffixOverrides="AND">
|
|
|
t1.deleted = 0 AND
|
|
|
<if test="id != null ">
|
|
@@ -38,7 +45,16 @@
|
|
|
t1.company_id = #{companyId} AND
|
|
|
</if>
|
|
|
<if test="principal != null and principal != ''">
|
|
|
- (t2.leader_id=#{principal} OR t2.adviser_id=#{principal}) AND
|
|
|
+ (t2.leader_id=#{principal} OR t2.adviser_id=#{principal}) AND
|
|
|
+ </if>
|
|
|
+ <if test="verifierName != null">
|
|
|
+ t6.nick_name like concat('%', #{verifierName}, '%')AND
|
|
|
+ </if>
|
|
|
+ <if test="dateFilter != null and dateFilter.size()>0 ">
|
|
|
+ (
|
|
|
+ DATE_FORMAT(t5.update_time,'%Y-%m-%d') >= #{dateFilter[0]} AND
|
|
|
+ DATE_FORMAT(t5.update_time,'%Y-%m-%d') <= #{dateFilter[1]}
|
|
|
+ )AND
|
|
|
</if>
|
|
|
<if test="accountSetsId != null ">
|
|
|
t1.account_sets_id = #{accountSetsId} AND
|
|
@@ -53,7 +69,7 @@
|
|
|
(t3.account_name like concat('%', #{fromCompanyName}, '%')) AND
|
|
|
</if>
|
|
|
<if test="companyName != null and companyName != ''">
|
|
|
- (t2.name like concat('%', #{companyName}, '%')) AND
|
|
|
+ (t2.name like concat('%', #{companyName}, '%')) AND
|
|
|
</if>
|
|
|
<if test="currentEmployeeId != null ">
|
|
|
t1.current_employee_id = #{currentEmployeeId} AND
|
|
@@ -90,11 +106,13 @@
|
|
|
) AND
|
|
|
</if>
|
|
|
<if test="status != null and status != 0">
|
|
|
- exists (select 1 from biz_housing_fund_confirm_detail fsd where fsd.housing_fund_confirm_id = t1.id and
|
|
|
+ exists (select 1 from biz_housing_fund_confirm_detail fsd where fsd.housing_fund_confirm_id = t1.id
|
|
|
+ and
|
|
|
fsd.month = #{month} and fsd.year = #{year} and fsd.status = #{status}) AND
|
|
|
</if>
|
|
|
<if test="status != null and status == 0">
|
|
|
- not exists (select 1 from biz_housing_fund_confirm_detail fsd where fsd.housing_fund_confirm_id = t1.id and
|
|
|
+ not exists (select 1 from biz_housing_fund_confirm_detail fsd where fsd.housing_fund_confirm_id =
|
|
|
+ t1.id and
|
|
|
fsd.month = #{month} and fsd.year = #{year}) AND
|
|
|
</if>
|
|
|
</if>
|
|
@@ -102,8 +120,9 @@
|
|
|
</sql>
|
|
|
|
|
|
<select id="getServiceName" resultType="String">
|
|
|
- SELECT s.nick_name FROM sys_user s
|
|
|
- WHERE s.user_id =(SELECT leader_id FROM biz_company WHERE id=#{company_id})
|
|
|
+ SELECT s.nick_name
|
|
|
+ FROM sys_user s
|
|
|
+ WHERE s.user_id = (SELECT leader_id FROM biz_company WHERE id = #{company_id})
|
|
|
</select>
|
|
|
|
|
|
<select id="getSocialCreditCode" resultType="String">
|