2024-05-23 17:24: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.system.mapper.EtFeeRuleMapper">
|
|
|
|
|
|
|
|
|
|
<resultMap type="EtFeeRule" id="EtFeeRuleResult">
|
|
|
|
|
<result property="ruleId" column="rule_id" />
|
|
|
|
|
<result property="name" column="name" />
|
|
|
|
|
<result property="explain" column="explain" />
|
|
|
|
|
<result property="status" column="status" />
|
|
|
|
|
<result property="autoRefundDeposit" column="auto_refund_deposit" />
|
|
|
|
|
<result property="orderExceedMinutes" column="order_exceed_minutes" />
|
|
|
|
|
<result property="orderExceedWarn" column="order_exceed_warn" />
|
|
|
|
|
<result property="freeRideTime" column="free_ride_time" />
|
|
|
|
|
<result property="rentalUnit" column="rental_unit" />
|
|
|
|
|
<result property="ridingRule" column="riding_rule" />
|
|
|
|
|
<result property="ridingRuleJson" column="riding_rule_json" />
|
|
|
|
|
<result property="chargingCycle" column="charging_cycle" />
|
|
|
|
|
<result property="chargingCycleValue" column="charging_cycle_value" />
|
|
|
|
|
<result property="cappedAmount" column="capped_amount" />
|
2024-05-25 10:58:40 +08:00
|
|
|
<result property="instructions" column="instructions" />
|
2024-05-23 17:24:41 +08:00
|
|
|
<result property="createBy" column="create_by" />
|
|
|
|
|
<result property="createTime" column="create_time" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectEtFeeRuleVo">
|
|
|
|
|
select rule_id, `name`, `explain`,
|
|
|
|
|
status, auto_refund_deposit, order_exceed_minutes, order_exceed_warn,
|
|
|
|
|
free_ride_time, rental_unit, riding_rule, riding_rule_json, charging_cycle, charging_cycle_value,
|
2024-05-25 10:58:40 +08:00
|
|
|
capped_amount, instructions, create_by, create_time from et_fee_rule
|
2024-05-23 17:24:41 +08:00
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectEtFeeRuleList" parameterType="EtFeeRule" resultMap="EtFeeRuleResult">
|
|
|
|
|
<include refid="selectEtFeeRuleVo"/>
|
|
|
|
|
<where>
|
|
|
|
|
<if test="name != null and name != ''"> and `name` like concat('%', #{name}, '%')</if>
|
|
|
|
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectEtFeeRuleByRuleId" parameterType="Long" resultMap="EtFeeRuleResult">
|
|
|
|
|
<include refid="selectEtFeeRuleVo"/>
|
|
|
|
|
where rule_id = #{ruleId}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectRuleListByAreaId" parameterType="Long" resultType="Long">
|
|
|
|
|
select r.rule_id
|
|
|
|
|
from et_fee_rule r
|
|
|
|
|
left join et_area_rule ar on ar.rule_id = r.rule_id
|
|
|
|
|
left join et_operating_area a on a.area_id = ar.area_id
|
|
|
|
|
where a.area_id = #{areaId}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectRuleNameListByAreaId" parameterType="Long" resultType="java.lang.String">
|
|
|
|
|
select r.`name`
|
|
|
|
|
from et_fee_rule r
|
|
|
|
|
left join et_area_rule ar on ar.rule_id = r.rule_id
|
|
|
|
|
left join et_operating_area a on a.area_id = ar.area_id
|
|
|
|
|
where a.area_id = #{areaId}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<insert id="insertEtFeeRule" parameterType="EtFeeRule" useGeneratedKeys="true" keyProperty="ruleId">
|
|
|
|
|
insert into et_fee_rule
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="name != null">`name`,</if>
|
|
|
|
|
<if test="explain != null">`explain`,</if>
|
|
|
|
|
<if test="status != null">status,</if>
|
|
|
|
|
<if test="autoRefundDeposit != null">auto_refund_deposit,</if>
|
|
|
|
|
<if test="orderExceedMinutes != null">order_exceed_minutes,</if>
|
|
|
|
|
<if test="orderExceedWarn != null">order_exceed_warn,</if>
|
|
|
|
|
<if test="freeRideTime != null">free_ride_time,</if>
|
|
|
|
|
<if test="rentalUnit != null">rental_unit,</if>
|
|
|
|
|
<if test="ridingRule != null">riding_rule,</if>
|
|
|
|
|
<if test="ridingRuleJson != null">riding_rule_json,</if>
|
|
|
|
|
<if test="chargingCycle != null">charging_cycle,</if>
|
|
|
|
|
<if test="chargingCycleValue != null">charging_cycle_value,</if>
|
|
|
|
|
<if test="cappedAmount != null">capped_amount,</if>
|
2024-05-25 10:58:40 +08:00
|
|
|
<if test="instructions != null">instructions,</if>
|
2024-05-23 17:24:41 +08:00
|
|
|
<if test="createBy != null">create_by,</if>
|
|
|
|
|
<if test="createTime != null">create_time,</if>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="name != null">#{name},</if>
|
|
|
|
|
<if test="explain != null">#{explain},</if>
|
|
|
|
|
<if test="status != null">#{status},</if>
|
|
|
|
|
<if test="autoRefundDeposit != null">#{autoRefundDeposit},</if>
|
|
|
|
|
<if test="orderExceedMinutes != null">#{orderExceedMinutes},</if>
|
|
|
|
|
<if test="orderExceedWarn != null">#{orderExceedWarn},</if>
|
|
|
|
|
<if test="freeRideTime != null">#{freeRideTime},</if>
|
|
|
|
|
<if test="rentalUnit != null">#{rentalUnit},</if>
|
|
|
|
|
<if test="ridingRule != null">#{ridingRule},</if>
|
|
|
|
|
<if test="ridingRuleJson != null">#{ridingRuleJson},</if>
|
|
|
|
|
<if test="chargingCycle != null">#{chargingCycle},</if>
|
|
|
|
|
<if test="chargingCycleValue != null">#{chargingCycleValue},</if>
|
|
|
|
|
<if test="cappedAmount != null">#{cappedAmount},</if>
|
2024-05-25 10:58:40 +08:00
|
|
|
<if test="instructions != null">#{instructions},</if>
|
2024-05-23 17:24:41 +08:00
|
|
|
<if test="createBy != null">#{createBy},</if>
|
|
|
|
|
<if test="createTime != null">#{createTime},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<update id="updateEtFeeRule" parameterType="EtFeeRule">
|
|
|
|
|
update et_fee_rule
|
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
|
<if test="name != null">`name` = #{name},</if>
|
|
|
|
|
<if test="explain != null">`explain` = #{explain},</if>
|
|
|
|
|
<if test="status != null">status = #{status},</if>
|
|
|
|
|
<if test="autoRefundDeposit != null">auto_refund_deposit = #{autoRefundDeposit},</if>
|
|
|
|
|
<if test="orderExceedMinutes != null">order_exceed_minutes = #{orderExceedMinutes},</if>
|
|
|
|
|
<if test="orderExceedWarn != null">order_exceed_warn = #{orderExceedWarn},</if>
|
|
|
|
|
<if test="freeRideTime != null">free_ride_time = #{freeRideTime},</if>
|
|
|
|
|
<if test="rentalUnit != null">rental_unit = #{rentalUnit},</if>
|
|
|
|
|
<if test="ridingRule != null">riding_rule = #{ridingRule},</if>
|
|
|
|
|
<if test="ridingRuleJson != null">riding_rule_json = #{ridingRuleJson},</if>
|
|
|
|
|
<if test="chargingCycle != null">charging_cycle = #{chargingCycle},</if>
|
|
|
|
|
<if test="chargingCycleValue != null">charging_cycle_value = #{chargingCycleValue},</if>
|
|
|
|
|
<if test="cappedAmount != null">capped_amount = #{cappedAmount},</if>
|
2024-05-25 10:58:40 +08:00
|
|
|
<if test="instructions != null">instructions = #{instructions},</if>
|
2024-05-23 17:24:41 +08:00
|
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
|
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
where rule_id = #{ruleId}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteEtFeeRuleByRuleId" parameterType="Long">
|
|
|
|
|
delete from et_fee_rule where rule_id = #{ruleId}
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteEtFeeRuleByRuleIds" parameterType="String">
|
|
|
|
|
delete from et_fee_rule where rule_id in
|
|
|
|
|
<foreach item="ruleId" collection="array" open="(" separator="," close=")">
|
|
|
|
|
#{ruleId}
|
|
|
|
|
</foreach>
|
|
|
|
|
</delete>
|
|
|
|
|
</mapper>
|