增加根据门店查询车型的接口实现

This commit is contained in:
2025-07-13 11:57:10 +08:00
parent 867a669836
commit 9ded13d973
4 changed files with 151 additions and 4 deletions

View File

@ -4,8 +4,39 @@
<select id="pageCarModelSimpleDTO" resultType="com.sczx.car.dto.CarModelSimpleDTO">
<!--
TODO - 根据门店信息查询车型信息,包含车型对应的套餐部分信息如:租赁类型、是否支持免押、是否支持代扣等
根据门店信息查询车型信息,包含车型对应的套餐部分信息如:租赁类型、是否支持免押、是否支持代扣等
-->
SELECT
cm.id AS car_model_id,
s.id AS store_id,
s.store_number AS store_number,
cm.model_name AS model_name,
cm.brand_name AS brand_name,
GROUP_CONCAT(DISTINCT r.rental_type SEPARATOR ',') AS battery_types,
MAX(r.deposit_free) AS deposit_free,
MAX(r.auto_deduct) AS auto_deduct
FROM
zc_car_model cm
JOIN
zc_car c ON cm.id = c.model_id
JOIN
zc_company_store s ON c.store_id = s.id
JOIN
zc_car_model_package mp ON cm.id = mp.car_model_id
JOIN
zc_rent_car_rule r ON mp.car_rule_id = r.id AND r.del_flag = '0' AND r.status = '0'
<where>
s.id = #{storeCarModelReq.storeId}
<if test="storeCarModelReq.depositFree != null and storeCarModelReq.depositFree != ''">
AND r.deposit_free = #{storeCarModelReq.depositFree}
</if>
<if test="storeCarModelReq.autoDeduct != null and storeCarModelReq.autoDeduct != ''">
AND r.auto_deduct = #{storeCarModelReq.autoDeduct}
</if>
AND cm.del_flag = '0' AND cm.status = '0'
</where>
GROUP BY
cm.id, s.id, s.store_number, cm.model_name, cm.brand_name
</select>
</mapper>