ride-lease/ridelease-system/src/main/resources/mapper/system/RlModelMapper.xml

107 lines
5.1 KiB
XML
Raw Normal View History

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-18 09:10:42 +08:00
<resultMap type="RlModel" id="EModelResult">
2024-09-11 14:10:40 +08:00
<result property="modelId" column="model_id" />
<result property="model" column="model" />
<result property="brand" column="brand" />
<result property="fullVoltage" column="full_voltage" />
<result property="lowVoltage" column="low_voltage" />
<result property="fullEndurance" column="full_endurance" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectEModelVo">
2024-09-18 09:10:42 +08:00
select model_id, model, brand, full_voltage, low_voltage, full_endurance, create_by, create_time, update_by, update_time, remark 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-11 14:10:40 +08:00
select m.model_id, m.model, m.brand, m.full_voltage, m.low_voltage,
m.full_endurance, m.create_by, m.create_time,
2024-09-18 09:10:42 +08:00
m.update_by, m.update_time, m.remark from rl_model m
2024-09-11 14:10:40 +08:00
-- left join sys_dept d on d.dept_id = m.operator
where 1 = 1
<if test="model != null and model != ''"> and m.model = #{model}</if>
<if test="brand != null and brand != ''"> and m.brand = #{brand}</if>
<!-- 数据范围过滤 <if test="operator != null and operator != ''"> and m.operator = #{operator}</if> -->
${params.dataScope}
</select>
<select id="selectEModelByModelId" parameterType="Long" resultMap="EModelResult">
select m.model_id, m.model, m.brand, d.dept_name, m.full_voltage, m.low_voltage,
m.full_endurance, m.create_by, m.create_time,
2024-09-18 09:10:42 +08:00
m.update_by, m.update_time, m.remark from rl_model m
2024-09-11 14:10:40 +08:00
-- left join sys_dept d on d.dept_id = m.operator
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-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="brand != null">brand,</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>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="modelId != null">#{modelId},</if>
<if test="model != null">#{model},</if>
<if test="brand != null">#{brand},</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>
</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="brand != null">brand = #{brand},</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>
</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>