| 
									
										
										
										
											2025-07-12 21:23:57 +08:00
										 |  |  | <?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"> | 
					
						
							|  |  |  |         <!--
 | 
					
						
							| 
									
										
										
										
											2025-07-13 11:57:10 +08:00
										 |  |  |           根据门店信息查询车型信息,包含车型对应的套餐部分信息如:租赁类型、是否支持免押、是否支持代扣等 | 
					
						
							| 
									
										
										
										
											2025-07-12 21:23:57 +08:00
										 |  |  |         --> | 
					
						
							| 
									
										
										
										
											2025-07-13 11:57:10 +08:00
										 |  |  |         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, | 
					
						
							| 
									
										
										
										
											2025-08-06 00:11:51 +08:00
										 |  |  |         cm.image AS image, | 
					
						
							| 
									
										
										
										
											2025-07-27 21:08:08 +08:00
										 |  |  |         GROUP_CONCAT(DISTINCT r.rental_type SEPARATOR ',') AS rental_types, | 
					
						
							| 
									
										
										
										
											2025-09-23 23:52:09 +08:00
										 |  |  |         MAX(r.deposit_free) AS deposit_free | 
					
						
							| 
									
										
										
										
											2025-07-13 11:57:10 +08:00
										 |  |  |         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' | 
					
						
							| 
									
										
										
										
											2025-09-27 20:53:29 +08:00
										 |  |  |         JOIN | 
					
						
							|  |  |  |         zc_company zc ON r.operating_company_id = zc.id and zc.id = s.operating_company_id and zc.status = '0' | 
					
						
							| 
									
										
										
										
											2025-07-13 11:57:10 +08:00
										 |  |  |         <where> | 
					
						
							|  |  |  |             s.id = #{storeCarModelReq.storeId} | 
					
						
							| 
									
										
										
										
											2025-09-23 23:52:09 +08:00
										 |  |  |             <if test="storeCarModelReq.depositFree != null and storeCarModelReq.depositFree != ''"> | 
					
						
							|  |  |  |                 and r.deposit_free = #{storeCarModelReq.depositFree} | 
					
						
							| 
									
										
										
										
											2025-07-13 11:57:10 +08:00
										 |  |  |             </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 | 
					
						
							| 
									
										
										
										
											2025-07-12 21:23:57 +08:00
										 |  |  |     </select> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-10-29 16:40:40 +08:00
										 |  |  |     <select id="getCarModelByThireId" resultType="com.sczx.car.dto.CarModelPackageDTO"> | 
					
						
							|  |  |  |         SELECT | 
					
						
							| 
									
										
										
										
											2025-10-29 21:13:50 +08:00
										 |  |  |             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 | 
					
						
							| 
									
										
										
										
											2025-10-29 16:40:40 +08:00
										 |  |  |         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> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-07-12 21:23:57 +08:00
										 |  |  | </mapper> |