This commit is contained in:
zhaotianfeng 2024-09-24 20:05:16 +08:00
parent 753d0f5200
commit 8a2bf03a20

View File

@ -3,13 +3,19 @@
<mapper namespace="cn.iocoder.yudao.module.app.car.mapper.AppCarMainMapper">
<select id="getUserCarMain" resultType="cn.iocoder.yudao.module.app.car.entity.AppCarMain">
<select id="getUserCarMain" resultType="cn.iocoder.yudao.module.app.car.vo.AppCarMainResVo">
select main.* from base_customer_car car INNER JOIN base_car_main main on car.car_id = main.id
where car.cus_id = (
select id from base_customer_main
where user_id = #{userId}
and deleted = 0
) and main.deleted = 0
SELECT main.*, brand.brand_name as brandName, brand.logo_img as logoImg
from (select main.*
from base_customer_car car
INNER JOIN base_car_main main on car.car_id = main.id
where car.cus_id = (
select id
from base_customer_main
where user_id = #{userId}
and deleted = 0
)
and main.deleted = 0) as main
LEFT JOIN base_car_brand brand on main.car_brand = brand.id
</select>
</mapper>