2024-09-23 20:09:45 +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.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" />
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<sql id="selectRlFeeRuleVo">
|
2024-10-19 10:06:03 +08:00
|
|
|
select r.rule_id, r.rental_unit, r.price, r.`explain`, r.instructions, r.out_unit, r.out_price, r.is_deleted from rl_fee_rule r
|
|
|
|
left join rl_model_rule mr on mr.rule_id = r.rule_id
|
2024-09-23 20:09:45 +08:00
|
|
|
</sql>
|
|
|
|
|
|
|
|
<select id="selectRlFeeRuleList" parameterType="RlFeeRule" resultMap="RlFeeRuleResult">
|
2024-10-19 10:06:03 +08:00
|
|
|
select r.rule_id, r.rental_unit, r.price, r.`explain`, r.instructions, r.out_unit, r.out_price, r.is_deleted from rl_fee_rule r
|
2024-10-10 08:50:13 +08:00
|
|
|
where del_flag = '0'
|
|
|
|
<if test="rentalUnit != null and rentalUnit != ''"> and r.rental_unit = #{rentalUnit}</if>
|
|
|
|
<if test="price != null "> and r.price = #{price}</if>
|
|
|
|
<if test="explain != null and explain != ''"> and r.`explain` = #{explain}</if>
|
|
|
|
<if test="instructions != null and instructions != ''"> and r.instructions = #{instructions}</if>
|
|
|
|
<if test="outUnit != null and outUnit != ''"> and r.out_unit = #{outUnit}</if>
|
|
|
|
<if test="outPrice != null "> and r.out_price = #{outPrice}</if>
|
|
|
|
<if test="isDeleted != null "> and r.is_deleted = #{isDeleted}</if>
|
2024-09-23 20:09:45 +08:00
|
|
|
</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>
|
|
|
|
|
2024-10-19 10:06:03 +08:00
|
|
|
<select id="selectRlFeeRuleLongListByModelId" resultType="java.lang.Long">
|
|
|
|
select r.rule_id from rl_fee_rule r
|
|
|
|
left join rl_model_rule mr on mr.rule_id = r.rule_id
|
|
|
|
where mr.model_id = #{modelId}
|
|
|
|
</select>
|
|
|
|
|
2024-09-23 20:09:45 +08:00
|
|
|
<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>
|
2024-09-25 18:11:10 +08:00
|
|
|
<if test="explain != null">`explain`,</if>
|
2024-09-23 20:09:45 +08:00
|
|
|
<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>
|
|
|
|
</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>
|
2024-09-25 18:11:10 +08:00
|
|
|
<if test="explain != null">`explain` = #{explain},</if>
|
2024-09-23 20:09:45 +08:00
|
|
|
<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>
|
2024-10-10 08:50:13 +08:00
|
|
|
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
2024-09-23 20:09:45 +08:00
|
|
|
</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>
|