feat:sql优化

This commit is contained in:
dzc committed 2026-03-11 14:17:49 +08:00
1 parent bce4bf9ee3
commit 9644338a59
3 files changed
+71 -5

No files matched your search

+1 -1
View File
@@ -1,4 +1,4 @@
MYSQL_HOST=123.157.250.162
MYSQL_PORT=2881
MYSQL_PORT=33905
MYSQL_USER=root@sys
MYSQL_PWD=bsd.1799
@@ -198,6 +198,76 @@
</sql>
<sql id="pageList">
select a.id,
a.order_no,
a.user_id,
a.user_dept_id,
a.merchant_id,
a.merchant_type,
a.merchant_dept_id,
a.hard_id,
a.dept_id,
a.wallet_id,
a.parent_car_id,
a.order_source_type_id,
a.order_type,
a.order_status,
a.pay_type,
a.hour_type,
a.sys_type,
a.total_price,
a.extra_price,
a.pay_price,
a.pay_time,
a.pay_refund_id,
a.refund_price,
a.refund_time,
a.refund_status,
a.apply_cancel_time,
a.android_order_code,
a.is_offline_order,
a.product_desc,
a.offline_pay_success,
a.create_by,
a.create_time,
a.update_by,
a.update_time,
a.del_flag,
a.tenant_id,
m.name as hardName,
m.type as hardType,
m.dept_id as hardTypeDeptId,
s.id as afterSaleId,
s.no as afterSaleNo
from (select a.id
from hard_order a
<where>
<include refid="whereA"/>
<if test="dto.hardTypeCode != null and dto.hardTypeCode != '' ">
and m.type = #{dto.hardTypeCode}
</if>
<if test="dto.hardTypeCodes != null and dto.hardTypeCodes.size() != 0">
and m.type in
<foreach collection="dto.hardTypeCodes" item="v" open="(" close=")" separator=",">
#{v}
</foreach>
</if>
<if test="dto.afterSaleNo != null and dto.afterSaleNo != ''">
and s.no = #{dto.afterSaleNo}
</if>
</where>
order by a.create_time desc, a.user_id desc) t
join hard_order a on a.id = t.id
left join hard_manager m on m.id = a.hard_id and m.tenant_id = 1
left join (select order_id, max(id) as id
from hard_after_sale
where tenant_id = 1
group by order_id) sx on sx.order_id = a.id
left join hard_after_sale s on s.id = sx.id
order by a.create_time desc, a.user_id desc
</sql>
<sql id="pageListCopy">
<include refid="selectA"/>
m.name as hardName,
m.type as hardType,
@@ -13,10 +13,6 @@ import javax.net.ssl.SSLSocketFactory;
/**
* 微信支付api
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class ThirdMiniWechantPayConstant {
public static final Api APY = Api.builder().summary("付款码支付").url("/pay/micropay").method(HttpMethod.POST).isNeedCertificate(false).build();