ride-lease/ridelease-system/src/main/resources/mapper/system/RlFeeRuleMapper.xml
18650502300 7578ab49fd 计算价格接口
还车时先判断是手机定位,再判断车辆定位
2024-09-26 08:58:28 +08:00

96 lines
4.5 KiB
XML

<?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.RlFeeRuleMapper">
<resultMap type="RlFeeRule" id="RlFeeRuleResult">
<result property="ruleId" column="rule_id" />
<result property="rentalUnit" column="rental_unit" />
<result property="price" column="price" />
<result property="explain" column="explain" />
<result property="instructions" column="instructions" />
<result property="outUnit" column="out_unit" />
<result property="outPrice" column="out_price" />
<result property="isDeleted" column="is_deleted" />
<result property="modelId" column="model_id" />
</resultMap>
<sql id="selectRlFeeRuleVo">
select rule_id, rental_unit, price, `explain`, instructions, out_unit, out_price, is_deleted, model_id from rl_fee_rule
</sql>
<select id="selectRlFeeRuleList" parameterType="RlFeeRule" resultMap="RlFeeRuleResult">
<include refid="selectRlFeeRuleVo"/>
<where>
<if test="rentalUnit != null and rentalUnit != ''"> and rental_unit = #{rentalUnit}</if>
<if test="price != null "> and price = #{price}</if>
<if test="explain != null and explain != ''"> and `explain` = #{explain}</if>
<if test="instructions != null and instructions != ''"> and instructions = #{instructions}</if>
<if test="outUnit != null and outUnit != ''"> and out_unit = #{outUnit}</if>
<if test="outPrice != null "> and out_price = #{outPrice}</if>
<if test="isDeleted != null "> and is_deleted = #{isDeleted}</if>
</where>
</select>
<select id="selectRlFeeRuleListByModelId" parameterType="Long" resultMap="RlFeeRuleResult">
<include refid="selectRlFeeRuleVo"/>
where model_id = #{modelId}
</select>
<select id="selectRlFeeRuleByRuleId" parameterType="Long" resultMap="RlFeeRuleResult">
<include refid="selectRlFeeRuleVo"/>
where rule_id = #{ruleId}
</select>
<insert id="insertRlFeeRule" parameterType="RlFeeRule" useGeneratedKeys="true" keyProperty="ruleId">
insert into rl_fee_rule
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="rentalUnit != null">rental_unit,</if>
<if test="price != null">price,</if>
<if test="explain != null">`explain`,</if>
<if test="instructions != null">instructions,</if>
<if test="outUnit != null">out_unit,</if>
<if test="outPrice != null">out_price,</if>
<if test="isDeleted != null">is_deleted,</if>
<if test="modelId != null">model_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="rentalUnit != null">#{rentalUnit},</if>
<if test="price != null">#{price},</if>
<if test="explain != null">#{explain},</if>
<if test="instructions != null">#{instructions},</if>
<if test="outUnit != null">#{outUnit},</if>
<if test="outPrice != null">#{outPrice},</if>
<if test="isDeleted != null">#{isDeleted},</if>
<if test="modelId != null">#{modelId},</if>
</trim>
</insert>
<update id="updateRlFeeRule" parameterType="RlFeeRule">
update rl_fee_rule
<trim prefix="SET" suffixOverrides=",">
<if test="rentalUnit != null">rental_unit = #{rentalUnit},</if>
<if test="price != null">price = #{price},</if>
<if test="explain != null">`explain` = #{explain},</if>
<if test="instructions != null">instructions = #{instructions},</if>
<if test="outUnit != null">out_unit = #{outUnit},</if>
<if test="outPrice != null">out_price = #{outPrice},</if>
<if test="isDeleted != null">is_deleted = #{isDeleted},</if>
<if test="modelId != null">model_id = #{modelId},</if>
</trim>
where rule_id = #{ruleId}
</update>
<delete id="deleteRlFeeRuleByRuleId" parameterType="Long">
delete from rl_fee_rule where rule_id = #{ruleId}
</delete>
<delete id="deleteRlFeeRuleByRuleIds" parameterType="String">
delete from rl_fee_rule where rule_id in
<foreach item="ruleId" collection="array" open="(" separator="," close=")">
#{ruleId}
</foreach>
</delete>
</mapper>