车型与套餐

This commit is contained in:
19173159168
2025-07-12 23:26:47 +08:00
parent 092d866283
commit f0812d0cba
13 changed files with 271 additions and 36 deletions

View File

@ -22,12 +22,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="extend1" column="extend1" />
<result property="extend2" column="extend2" />
<result property="extend3" column="extend3" />
<collection property="rentCarRuleList" javaType="java.util.List" resultMap="RentCarRuleResult" />
</resultMap>
<resultMap id="RentCarRuleResult" type="ZcRentCarRule">
<id property="carRuleId" column="carRuleId" />
<result property="ruleName" column="rule_name" />
<result property="ruleCode" column="rule_code" />
<result property="rentalType" column="rental_type" />
</resultMap>
<sql id="selectZcCarModelVo">
select id, model_name, brand_id, brand_name, battery_type, max_speed, weight, status, del_flag, create_by, create_time, update_by, update_time, remark, extend1, extend2, extend3 from zc_car_model
</sql>
<sql id="selectZcCarModelVo2">
select u.*,
r.id as carRuleId, r.rule_name, r.rule_code, r.rental_type
from zc_car_model u
left join zc_car_model_package p on u.id = p.car_model_id
left join zc_rent_car_rule r on r.id = p.car_rule_id
</sql>
<select id="selectZcCarModelList" parameterType="ZcCarModel" resultMap="ZcCarModelResult">
<include refid="selectZcCarModelVo"/>
<where>
@ -38,8 +54,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectZcCarModelById" parameterType="Long" resultMap="ZcCarModelResult">
<include refid="selectZcCarModelVo"/>
where id = #{id}
<include refid="selectZcCarModelVo2"/>
where u.id = #{id}
</select>
<insert id="insertZcCarModel" parameterType="ZcCarModel" useGeneratedKeys="true" keyProperty="id">