Files
sczx_web/ruoyi-admin/src/main/resources/mapper/operation/ZcRentBatteyRuleMapper.xml

182 lines
11 KiB
XML
Raw Normal View History

2025-07-08 00:58:41 +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.ruoyi.operation.mapper.ZcRentBatteyRuleMapper">
<resultMap type="ZcRentBatteyRule" id="ZcRentBatteyRuleResult">
<result property="id" column="id" />
<result property="title" column="title" />
<result property="detail" column="detail" />
<result property="icon" column="icon" />
<result property="voltage" column="voltage" />
<result property="ah" column="ah" />
<result property="maxMileage" column="max_mileage" />
<result property="minMileage" column="min_mileage" />
<result property="depositPrice" column="deposit_price" />
<result property="rentPrice" column="rent_price" />
<result property="durationType" column="duration_type" />
<result property="duration" column="duration" />
<result property="insurancePrice" column="insurance_price" />
<result property="compulsoryInsurance" column="compulsory_insurance" />
<result property="insuranceDuration" column="insurance_duration" />
<result property="changeNum" column="change_num" />
<result property="changeType" column="change_type" />
<result property="isDelete" column="is_delete" />
<result property="cityId" column="city_id" />
<result property="operatorId" column="operator_id" />
<result property="provinceId" column="province_id" />
<result property="categoryId" column="category_id" />
<result property="mealType" column="meal_type" />
<result property="mealSort" column="meal_sort" />
<result property="isJoinInvite" column="is_join_invite" />
<result property="mealChannel" column="meal_channel" />
<result property="buyLimitType" column="buy_limit_type" />
</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>
<select id="selectZcRentBatteyRuleList" parameterType="ZcRentBatteyRule" resultMap="ZcRentBatteyRuleResult">
<include refid="selectZcRentBatteyRuleVo"/>
<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>
</where>
</select>
<select id="selectZcRentBatteyRuleById" parameterType="Long" resultMap="ZcRentBatteyRuleResult">
<include refid="selectZcRentBatteyRuleVo"/>
where id = #{id}
</select>
<insert id="insertZcRentBatteyRule" parameterType="ZcRentBatteyRule" useGeneratedKeys="true" keyProperty="id">
insert into zc_rent_battey_rule
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="title != null and title != ''">title,</if>
<if test="detail != null and detail != ''">detail,</if>
<if test="icon != null">icon,</if>
<if test="voltage != null and voltage != ''">voltage,</if>
<if test="ah != null and ah != ''">ah,</if>
<if test="maxMileage != null">max_mileage,</if>
<if test="minMileage != null">min_mileage,</if>
<if test="depositPrice != null">deposit_price,</if>
<if test="rentPrice != null">rent_price,</if>
<if test="durationType != null">duration_type,</if>
<if test="duration != null">duration,</if>
<if test="insurancePrice != null">insurance_price,</if>
<if test="compulsoryInsurance != null">compulsory_insurance,</if>
<if test="insuranceDuration != null">insurance_duration,</if>
<if test="changeNum != null">change_num,</if>
<if test="changeType != null">change_type,</if>
<if test="isDelete != null">is_delete,</if>
<if test="cityId != null">city_id,</if>
<if test="operatorId != null">operator_id,</if>
<if test="provinceId != null">province_id,</if>
<if test="categoryId != null">category_id,</if>
<if test="mealType != null">meal_type,</if>
<if test="mealSort != null">meal_sort,</if>
<if test="isJoinInvite != null">is_join_invite,</if>
<if test="mealChannel != null">meal_channel,</if>
<if test="buyLimitType != null">buy_limit_type,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="title != null and title != ''">#{title},</if>
<if test="detail != null and detail != ''">#{detail},</if>
<if test="icon != null">#{icon},</if>
<if test="voltage != null and voltage != ''">#{voltage},</if>
<if test="ah != null and ah != ''">#{ah},</if>
<if test="maxMileage != null">#{maxMileage},</if>
<if test="minMileage != null">#{minMileage},</if>
<if test="depositPrice != null">#{depositPrice},</if>
<if test="rentPrice != null">#{rentPrice},</if>
<if test="durationType != null">#{durationType},</if>
<if test="duration != null">#{duration},</if>
<if test="insurancePrice != null">#{insurancePrice},</if>
<if test="compulsoryInsurance != null">#{compulsoryInsurance},</if>
<if test="insuranceDuration != null">#{insuranceDuration},</if>
<if test="changeNum != null">#{changeNum},</if>
<if test="changeType != null">#{changeType},</if>
<if test="isDelete != null">#{isDelete},</if>
<if test="cityId != null">#{cityId},</if>
<if test="operatorId != null">#{operatorId},</if>
<if test="provinceId != null">#{provinceId},</if>
<if test="categoryId != null">#{categoryId},</if>
<if test="mealType != null">#{mealType},</if>
<if test="mealSort != null">#{mealSort},</if>
<if test="isJoinInvite != null">#{isJoinInvite},</if>
<if test="mealChannel != null">#{mealChannel},</if>
<if test="buyLimitType != null">#{buyLimitType},</if>
</trim>
</insert>
<update id="updateZcRentBatteyRule" parameterType="ZcRentBatteyRule">
update zc_rent_battey_rule
<trim prefix="SET" suffixOverrides=",">
<if test="title != null and title != ''">title = #{title},</if>
<if test="detail != null and detail != ''">detail = #{detail},</if>
<if test="icon != null">icon = #{icon},</if>
<if test="voltage != null and voltage != ''">voltage = #{voltage},</if>
<if test="ah != null and ah != ''">ah = #{ah},</if>
<if test="maxMileage != null">max_mileage = #{maxMileage},</if>
<if test="minMileage != null">min_mileage = #{minMileage},</if>
<if test="depositPrice != null">deposit_price = #{depositPrice},</if>
<if test="rentPrice != null">rent_price = #{rentPrice},</if>
<if test="durationType != null">duration_type = #{durationType},</if>
<if test="duration != null">duration = #{duration},</if>
<if test="insurancePrice != null">insurance_price = #{insurancePrice},</if>
<if test="compulsoryInsurance != null">compulsory_insurance = #{compulsoryInsurance},</if>
<if test="insuranceDuration != null">insurance_duration = #{insuranceDuration},</if>
<if test="changeNum != null">change_num = #{changeNum},</if>
<if test="changeType != null">change_type = #{changeType},</if>
<if test="isDelete != null">is_delete = #{isDelete},</if>
<if test="cityId != null">city_id = #{cityId},</if>
<if test="operatorId != null">operator_id = #{operatorId},</if>
<if test="provinceId != null">province_id = #{provinceId},</if>
<if test="categoryId != null">category_id = #{categoryId},</if>
<if test="mealType != null">meal_type = #{mealType},</if>
<if test="mealSort != null">meal_sort = #{mealSort},</if>
<if test="isJoinInvite != null">is_join_invite = #{isJoinInvite},</if>
<if test="mealChannel != null">meal_channel = #{mealChannel},</if>
<if test="buyLimitType != null">buy_limit_type = #{buyLimitType},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteZcRentBatteyRuleById" parameterType="Long">
delete from zc_rent_battey_rule where id = #{id}
</delete>
<delete id="deleteZcRentBatteyRuleByIds" parameterType="String">
delete from zc_rent_battey_rule where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>