租车套餐选择租电套餐时增加城市描述

This commit is contained in:
majian314
2025-09-26 15:46:38 +08:00
parent 46532f7d8a
commit 399a365224
3 changed files with 48 additions and 32 deletions

View File

@ -126,6 +126,8 @@ public class ZcRentBatteyRule extends BaseEntity
@Transient
private String queryDurationType;
@Transient
private String cityName;
public void setId(Long id)
{
@ -379,6 +381,14 @@ public class ZcRentBatteyRule extends BaseEntity
this.queryDurationType = queryDurationType;
}
public String getCityName() {
return cityName;
}
public void setCityName(String cityName) {
this.cityName = cityName;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

View File

@ -32,47 +32,53 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="isJoinInvite" column="is_join_invite" />
<result property="mealChannel" column="meal_channel" />
<result property="buyLimitType" column="buy_limit_type" />
<result property="cityName" column="city_name" />
</resultMap>
<sql id="selectZcRentBatteyRuleVo">
select id, title, detail, icon, voltage, ah, max_mileage, min_mileage, deposit_price, rent_price, duration_type, duration, insurance_price, compulsory_insurance, insurance_duration, change_num, change_type, is_delete, city_id, operator_id, province_id, category_id, meal_type, meal_sort, is_join_invite, meal_channel, buy_limit_type from zc_rent_battey_rule
</sql>
<sql id="selectZcRentBatteyRuleVo2">
select a.id, a.title, a.detail, a.icon, a.voltage, a.ah, a.max_mileage, a.min_mileage, a.deposit_price, a.rent_price,
a.duration_type, a.duration, a.insurance_price, a.compulsory_insurance, a.insurance_duration, a.change_num, a.change_type, a.is_delete, a.city_id, a.operator_id, a.province_id, a.category_id, a.meal_type, a.meal_sort, a.is_join_invite, a.meal_channel, a.buy_limit_type,
b.name as 'city_name'
from zc_rent_battey_rule a left join sys_area_hn b on a.city_id = b.area_code
</sql>
<select id="selectZcRentBatteyRuleList" parameterType="ZcRentBatteyRule" resultMap="ZcRentBatteyRuleResult">
<include refid="selectZcRentBatteyRuleVo"/>
<include refid="selectZcRentBatteyRuleVo2"/>
<where>
<if test="title != null and title != ''"> and title = #{title}</if>
<if test="detail != null and detail != ''"> and detail = #{detail}</if>
<if test="icon != null and icon != ''"> and icon = #{icon}</if>
<if test="voltage != null and voltage != ''"> and voltage = #{voltage}</if>
<if test="ah != null and ah != ''"> and ah = #{ah}</if>
<if test="maxMileage != null "> and max_mileage = #{maxMileage}</if>
<if test="minMileage != null "> and min_mileage = #{minMileage}</if>
<if test="depositPrice != null "> and deposit_price = #{depositPrice}</if>
<if test="rentPrice != null "> and rent_price = #{rentPrice}</if>
<if test="durationType != null "> and duration_type = #{durationType}</if>
<if test="duration != null "> and duration = #{duration}</if>
<if test="insurancePrice != null "> and insurance_price = #{insurancePrice}</if>
<if test="compulsoryInsurance != null "> and compulsory_insurance = #{compulsoryInsurance}</if>
<if test="insuranceDuration != null "> and insurance_duration = #{insuranceDuration}</if>
<if test="changeNum != null "> and change_num = #{changeNum}</if>
<if test="changeType != null "> and change_type = #{changeType}</if>
<if test="isDelete != null "> and is_delete = #{isDelete}</if>
<if test="cityId != null "> and city_id = #{cityId}</if>
<if test="operatorId != null "> and operator_id = #{operatorId}</if>
<if test="provinceId != null "> and province_id = #{provinceId}</if>
<if test="categoryId != null "> and category_id = #{categoryId}</if>
<if test="mealType != null "> and meal_type = #{mealType}</if>
<if test="mealSort != null "> and meal_sort = #{mealSort}</if>
<if test="isJoinInvite != null "> and is_join_invite = #{isJoinInvite}</if>
<if test="mealChannel != null "> and meal_channel = #{mealChannel}</if>
<if test="buyLimitType != null "> and buy_limit_type = #{buyLimitType}</if>
<if test="title != null and title != ''"> and a.title = #{title}</if>
<if test="detail != null and detail != ''"> and a.detail = #{detail}</if>
<if test="icon != null and icon != ''"> and a.icon = #{icon}</if>
<if test="voltage != null and voltage != ''"> and a.voltage = #{voltage}</if>
<if test="ah != null and ah != ''"> and a.ah = #{ah}</if>
<if test="maxMileage != null "> and a.max_mileage = #{maxMileage}</if>
<if test="minMileage != null "> and a.min_mileage = #{minMileage}</if>
<if test="depositPrice != null "> and a.deposit_price = #{depositPrice}</if>
<if test="rentPrice != null "> and a.rent_price = #{rentPrice}</if>
<if test="durationType != null "> and a.duration_type = #{durationType}</if>
<if test="duration != null "> and a.duration = #{duration}</if>
<if test="insurancePrice != null "> and a.insurance_price = #{insurancePrice}</if>
<if test="compulsoryInsurance != null "> and a.compulsory_insurance = #{compulsoryInsurance}</if>
<if test="insuranceDuration != null "> and a.insurance_duration = #{insuranceDuration}</if>
<if test="changeNum != null "> and a.change_num = #{changeNum}</if>
<if test="changeType != null "> and a.change_type = #{changeType}</if>
<if test="isDelete != null "> and a.is_delete = #{isDelete}</if>
<if test="cityId != null "> and a.city_id = #{cityId}</if>
<if test="operatorId != null "> and a.operator_id = #{operatorId}</if>
<if test="provinceId != null "> and a.province_id = #{provinceId}</if>
<if test="categoryId != null "> and a.category_id = #{categoryId}</if>
<if test="mealType != null "> and a.meal_type = #{mealType}</if>
<if test="mealSort != null "> and a.meal_sort = #{mealSort}</if>
<if test="isJoinInvite != null "> and a.is_join_invite = #{isJoinInvite}</if>
<if test="mealChannel != null "> and a.meal_channel = #{mealChannel}</if>
<if test="buyLimitType != null "> and a.buy_limit_type = #{buyLimitType}</if>
<if test="queryDurationType != null and queryDurationType != '' and queryDurationType == 2">
AND duration_type = 1
AND duration = 1
AND a.duration_type = 1
AND a.duration = 1
</if>
<if test="queryDurationType != null and queryDurationType != '' and queryDurationType == 3">
AND (duration_type = 2 OR (duration_type = 1 AND duration <![CDATA[ > ]]> 1))
AND (a.duration_type = 2 OR (a.duration_type = 1 AND a.duration <![CDATA[ > ]]> 1))
</if>
</where>
</select>

View File

@ -167,7 +167,7 @@
$.modal.alert("未找到与租赁类型相同的租电套餐");
}
data.forEach(function(rule) {
html += `<div class="checkbox"><label><input type="checkbox" id="batteryRules" name="batteryRules" value="${rule.id}"> ${rule.title},电压${rule.voltage},电容${rule.ah},租赁${rule.duration}天</label></div>`;
html += `<div class="checkbox"><label><input type="checkbox" id="batteryRules" name="batteryRules" value="${rule.id}">${rule.cityName}${rule.title},电压${rule.voltage},电容${rule.ah},租赁${rule.duration}天</label></div>`;
});
$('#batteryRuleList').html(html);
});