2024-09-11 14:10:40 +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">
|
2024-09-18 09:10:42 +08:00
|
|
|
<mapper namespace="com.ruoyi.system.mapper.RlModelMapper">
|
2024-09-11 14:10:40 +08:00
|
|
|
|
2024-09-25 18:11:10 +08:00
|
|
|
<resultMap type="RlModelVO" id="EModelResult" autoMapping="true" />
|
2024-09-11 14:10:40 +08:00
|
|
|
|
|
|
|
<sql id="selectEModelVo">
|
2024-09-28 09:54:53 +08:00
|
|
|
select model_id, model, full_voltage, low_voltage, full_endurance, create_by, create_time, update_by, update_time, remark, intro, agent_id, deposit, picture, description from rl_model
|
2024-09-11 14:10:40 +08:00
|
|
|
</sql>
|
|
|
|
|
2024-09-18 09:10:42 +08:00
|
|
|
<select id="selectEModelList" parameterType="RlModel" resultMap="EModelResult">
|
2024-09-19 11:25:42 +08:00
|
|
|
select m.model_id, m.model, m.full_voltage, m.low_voltage,
|
2024-10-10 08:50:13 +08:00
|
|
|
m.full_endurance, m.create_by, m.create_time,a.name agnetName,
|
2024-09-28 09:54:53 +08:00
|
|
|
m.update_by, m.update_time, m.remark, m.intro, m.agent_id, m.deposit, m.picture,m.description from rl_model m
|
2024-10-10 08:50:13 +08:00
|
|
|
left join rl_agent a on a.agent_id = m.agent_id
|
|
|
|
where m.del_flag = '0'
|
2024-09-11 14:10:40 +08:00
|
|
|
<if test="model != null and model != ''"> and m.model = #{model}</if>
|
|
|
|
<!-- 数据范围过滤 <if test="operator != null and operator != ''"> and m.operator = #{operator}</if> -->
|
|
|
|
${params.dataScope}
|
|
|
|
</select>
|
|
|
|
|
2024-09-19 11:25:42 +08:00
|
|
|
<select id="selectEModelListByAgentId" parameterType="RlModel" resultMap="EModelResult">
|
|
|
|
select m.model_id, m.model, m.full_voltage, m.low_voltage,
|
|
|
|
m.full_endurance, m.create_by, m.create_time,
|
2024-09-28 09:54:53 +08:00
|
|
|
m.update_by, m.update_time, m.remark, m.intro, m.agent_id, m.deposit, m.picture, m.description from rl_model m
|
2024-09-19 11:25:42 +08:00
|
|
|
where m.agent_id = #{agentId}
|
|
|
|
</select>
|
|
|
|
|
2024-09-11 14:10:40 +08:00
|
|
|
<select id="selectEModelByModelId" parameterType="Long" resultMap="EModelResult">
|
2024-09-19 11:25:42 +08:00
|
|
|
select m.model_id, m.model, m.full_voltage, m.low_voltage,
|
2024-09-11 14:10:40 +08:00
|
|
|
m.full_endurance, m.create_by, m.create_time,
|
2024-09-28 09:54:53 +08:00
|
|
|
m.update_by, m.update_time, m.remark, m.intro, m.agent_id, m.deposit, m.picture, m.description from rl_model m
|
2024-09-11 14:10:40 +08:00
|
|
|
where m.model_id = #{modelId}
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectAllCount" resultType="java.lang.Integer">
|
2024-09-18 09:10:42 +08:00
|
|
|
select count(1) from rl_model
|
2024-09-11 14:10:40 +08:00
|
|
|
</select>
|
|
|
|
|
2024-09-25 18:11:10 +08:00
|
|
|
<select id="selectEModelListByStoreId" parameterType="RlModelVO" resultMap="EModelResult">
|
|
|
|
SELECT
|
|
|
|
m.model_id,
|
|
|
|
m.model,
|
|
|
|
m.full_voltage,
|
|
|
|
m.low_voltage,
|
|
|
|
m.full_endurance,
|
|
|
|
m.create_by,
|
|
|
|
m.create_time,
|
|
|
|
m.update_by,
|
|
|
|
m.update_time,
|
|
|
|
m.remark,
|
|
|
|
m.intro,
|
|
|
|
m.agent_id,
|
|
|
|
m.deposit,
|
|
|
|
m.picture,
|
2024-09-28 09:54:53 +08:00
|
|
|
m.description,
|
2024-09-25 18:11:10 +08:00
|
|
|
fr.price,
|
|
|
|
fr.rental_unit
|
|
|
|
FROM
|
|
|
|
rl_model m
|
|
|
|
LEFT JOIN rl_model_store ms ON ms.mode_id = m.model_id
|
|
|
|
LEFT JOIN rl_fee_rule fr ON fr.model_id = m.model_id
|
|
|
|
WHERE
|
|
|
|
ms.store_id = #{storeId}
|
|
|
|
AND fr.price = ( SELECT MIN( fr2.price ) FROM rl_fee_rule fr2 WHERE fr2.model_id = m.model_id )
|
|
|
|
GROUP BY
|
|
|
|
m.model_id
|
|
|
|
</select>
|
|
|
|
|
2024-10-10 08:50:13 +08:00
|
|
|
<select id="getModelListByMerchantId" resultType="com.ruoyi.system.domain.model.RlModelVO">
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
2024-09-18 09:10:42 +08:00
|
|
|
<insert id="insertEModel" parameterType="RlModel" keyProperty="modelId" useGeneratedKeys="true">
|
|
|
|
insert into rl_model
|
2024-09-11 14:10:40 +08:00
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="modelId != null">model_id,</if>
|
|
|
|
<if test="model != null">model,</if>
|
|
|
|
<if test="fullVoltage != null">full_voltage,</if>
|
|
|
|
<if test="lowVoltage != null">low_voltage,</if>
|
|
|
|
<if test="fullEndurance != null">full_endurance,</if>
|
|
|
|
<if test="createBy != null">create_by,</if>
|
|
|
|
<if test="createTime != null">create_time,</if>
|
|
|
|
<if test="updateBy != null">update_by,</if>
|
|
|
|
<if test="updateTime != null">update_time,</if>
|
|
|
|
<if test="remark != null">remark,</if>
|
2024-09-19 17:13:15 +08:00
|
|
|
<if test="intro != null">intro,</if>
|
|
|
|
<if test="agentId != null">agent_id,</if>
|
|
|
|
<if test="deposit != null">deposit,</if>
|
2024-09-25 18:11:10 +08:00
|
|
|
<if test="picture != null">picture,</if>
|
2024-09-28 09:54:53 +08:00
|
|
|
<if test="description != null">description,</if>
|
2024-09-11 14:10:40 +08:00
|
|
|
</trim>
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="modelId != null">#{modelId},</if>
|
|
|
|
<if test="model != null">#{model},</if>
|
|
|
|
<if test="fullVoltage != null">#{fullVoltage},</if>
|
|
|
|
<if test="lowVoltage != null">#{lowVoltage},</if>
|
|
|
|
<if test="fullEndurance != null">#{fullEndurance},</if>
|
|
|
|
<if test="createBy != null">#{createBy},</if>
|
|
|
|
<if test="createTime != null">#{createTime},</if>
|
|
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
|
|
<if test="remark != null">#{remark},</if>
|
2024-09-19 17:13:15 +08:00
|
|
|
<if test="intro != null">#{intro},</if>
|
|
|
|
<if test="agentId != null">#{agentId},</if>
|
|
|
|
<if test="deposit != null">#{deposit},</if>
|
2024-09-25 18:11:10 +08:00
|
|
|
<if test="picture != null">#{picture},</if>
|
2024-09-28 09:54:53 +08:00
|
|
|
<if test="description != null">#{description},</if>
|
2024-09-11 14:10:40 +08:00
|
|
|
</trim>
|
|
|
|
</insert>
|
|
|
|
|
2024-09-18 09:10:42 +08:00
|
|
|
<update id="updateEModel" parameterType="RlModel">
|
|
|
|
update rl_model
|
2024-09-11 14:10:40 +08:00
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
<if test="model != null">model = #{model},</if>
|
|
|
|
<if test="fullVoltage != null">full_voltage = #{fullVoltage},</if>
|
|
|
|
<if test="lowVoltage != null">low_voltage = #{lowVoltage},</if>
|
|
|
|
<if test="fullEndurance != null">full_endurance = #{fullEndurance},</if>
|
|
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
|
<if test="remark != null">remark = #{remark},</if>
|
2024-09-19 17:13:15 +08:00
|
|
|
<if test="intro != null">intro = #{intro},</if>
|
|
|
|
<if test="agentId != null">agent_id = #{agentId},</if>
|
|
|
|
<if test="deposit != null">deposit = #{deposit},</if>
|
2024-09-25 18:11:10 +08:00
|
|
|
<if test="picture != null">picture = #{picture},</if>
|
2024-09-28 09:54:53 +08:00
|
|
|
<if test="description != null">description = #{description},</if>
|
2024-10-10 08:50:13 +08:00
|
|
|
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
2024-09-11 14:10:40 +08:00
|
|
|
</trim>
|
|
|
|
where model_id = #{modelId}
|
|
|
|
</update>
|
|
|
|
|
|
|
|
<delete id="deleteEModelByModelId" parameterType="Long">
|
2024-09-18 09:10:42 +08:00
|
|
|
delete from rl_model where model_id = #{modelId}
|
2024-09-11 14:10:40 +08:00
|
|
|
</delete>
|
|
|
|
|
|
|
|
<delete id="deleteEModelByModelIds" parameterType="String">
|
2024-09-18 09:10:42 +08:00
|
|
|
delete from rl_model where model_id in
|
2024-09-11 14:10:40 +08:00
|
|
|
<foreach item="modelId" collection="array" open="(" separator="," close=")">
|
|
|
|
#{modelId}
|
|
|
|
</foreach>
|
|
|
|
</delete>
|
|
|
|
</mapper>
|