61 lines
2.3 KiB
XML
61 lines
2.3 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="com.sczx.car.mapper.CarModelMapper">
|
|
|
|
<select id="pageCarModelSimpleDTO" resultType="com.sczx.car.dto.CarModelSimpleDTO">
|
|
<!--
|
|
根据门店信息查询车型信息,包含车型对应的套餐部分信息如:租赁类型、是否支持免押、是否支持代扣等
|
|
-->
|
|
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,
|
|
cm.image AS image,
|
|
GROUP_CONCAT(DISTINCT r.rental_type SEPARATOR ',') AS rental_types,
|
|
MAX(r.deposit_free) AS deposit_free
|
|
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'
|
|
JOIN
|
|
zc_company zc ON r.operating_company_id = zc.id and zc.id = s.operating_company_id and zc.status = '0'
|
|
<where>
|
|
s.id = #{storeCarModelReq.storeId}
|
|
<if test="storeCarModelReq.depositFree != null and storeCarModelReq.depositFree != ''">
|
|
and r.deposit_free = #{storeCarModelReq.depositFree}
|
|
</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>
|
|
|
|
<select id="getCarModelByThireId" resultType="com.sczx.car.dto.CarModelPackageDTO">
|
|
SELECT
|
|
car_rule_id as carRuleId,
|
|
car_model_id as carModelId,
|
|
battery_rule_id as batteryRuleId,
|
|
mt_product_id as mtProductId,
|
|
dy_product_id as dyProductId
|
|
FROM
|
|
zc_car_model_package
|
|
<where>
|
|
<if test="mtId != null and mtId != ''">
|
|
and mt_product_id = #{mtId}
|
|
</if>
|
|
<if test="dyId != null and dyId != ''">
|
|
and dy_product_id = #{dyId}
|
|
</if>
|
|
</where>
|
|
</select>
|
|
|
|
</mapper>
|