Преглед изворни кода

【sql][修改][租金账单索引]

release_toaliyun_real
gongbiao пре 6 година
родитељ
комит
2c982bcb37
2 измењених фајлова са 10 додато и 7 уклоњено
  1. +3
    -0
      mallinkAdmin/src/main/resources/db/migration/V201907081942__G_ALTER_BILL_RENT.sql
  2. +7
    -7
      mallinkService/src/main/resources/mapper/WxBillRentMapper.xml

+ 3
- 0
mallinkAdmin/src/main/resources/db/migration/V201907081942__G_ALTER_BILL_RENT.sql Прегледај датотеку

@@ -0,0 +1,3 @@
alter table wx_bill_rent drop index t_p,
drop index r_m,
add index t_p_r_s_c(tenant_id,is_preview,rent_shop_type,status,createtime);

+ 7
- 7
mallinkService/src/main/resources/mapper/WxBillRentMapper.xml Прегледај датотеку

@@ -95,31 +95,31 @@
<select id="queryBillRentList" parameterType="com.iformall.domain.po.WxBillRent" resultMap="BaseResultMap">
select br.`id`,br.`receive_pay`,br.`pay`,br.`receive_date`,br.`pay_date`,br.`createtime`,br.`expired_day`,
case when br.status=1 then br.owe else 0 end owe,br.`status`,br.`need_pay`,m.`name` merchant_name,
case when br.status=1 then br.owe else 0 end owe,br.`status`,br.`need_pay`,r.merchant_name,
s.shop_number,br.`updatetime`,br.`merchant_id`,br.`rent_shop_type`,r.type as rent_type,
r.pay_ratio,br.`revenue`,br.`late_pay_ratio`,br.`late_pay_time`,br.`period`,br.`rent_contract_id`,
d.receive_pay deposit,case when br.late_pay_status=2 then (case when br.late_pay_time is null then 0
else FLOOR(DATEDIFF(now(),br.late_pay_time)*br.late_pay_ratio/10000*br.owe)end) else br.late_pay_price end
late_pay_price,d.`status`
deposit_status,br.shop_info,br.pay_way,br.late_pay_status,br.`comments`,br.starttime,br.endtime
from wx_bill_rent br left join wx_merchant m on br.merchant_id=m.id
from wx_bill_rent br
left join wx_shop s on br.shop_id=s.id
left join wx_rent_contract r on br.rent_contract_id=r.id
left join wx_bill_rent_deposit d on br.rent_contract_id=d.rent_contract_id and br.merchant_id=d.merchant_id
<where>
br.is_preview = 0
<if test=" null != rentShopType ">and br.`rent_shop_type` = #{rentShopType}</if>
<if test=" null != status ">and br.`status` = #{status}</if>
<if test=" null != depositStatus ">and d.`status` = #{depositStatus}</if>
<if test=" null != id ">and br.`id` = #{id}</if>
<if test=" null != merchantId ">and br.`merchant_id` = #{merchantId}</if>
<if test=" null != merchantName and ''!=merchantName ">and m.`name` like concat('%',#{merchantName},'%')</if>
<if test=" null != status ">and br.`status` = #{status}</if>
<if test=" null != isDel ">and br.`is_del` = #{isDel}</if>
<if test=" null != starttime and null!=endtime ">and br.`receive_date` between #{starttime} and #{endtime}</if>
<if test=" null != rentShopType ">and br.`rent_shop_type` = #{rentShopType}</if>
<if test=" null != rentContractId ">and br.`rent_contract_id` = #{rentContractId}</if>
<if test=" null != payWay ">and br.`pay_way` = #{payWay}</if>
<if test=" null != latePayStatus ">and br.`late_pay_status` = #{latePayStatus}</if>
<if test=" null != depositStatus ">and d.`status` = #{depositStatus}</if>
<if test=" null != starttime and null!=endtime ">and br.`receive_date` between #{starttime} and #{endtime}
</if>
</where>
<if test=" null != sortColumns">order by ${sortColumns}</if>
</select>


Loading…
Откажи
Сачувај