Files
sczx_web/ruoyi-admin/src/main/resources/mapper/operation/ZcCarModelMapper.xml

119 lines
6.1 KiB
XML
Raw Normal View History

2025-07-11 00:03:54 +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.operation.mapper.ZcCarModelMapper">
<resultMap type="ZcCarModel" id="ZcCarModelResult">
<result property="id" column="id" />
<result property="modelName" column="model_name" />
<result property="brandId" column="brand_id" />
<result property="brandName" column="brand_name" />
<result property="batteryType" column="battery_type" />
<result property="maxSpeed" column="max_speed" />
<result property="weight" column="weight" />
<result property="status" column="status" />
<result property="delFlag" column="del_flag" />
<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" />
<result property="extend1" column="extend1" />
<result property="extend2" column="extend2" />
<result property="extend3" column="extend3" />
</resultMap>
<sql id="selectZcCarModelVo">
select id, model_name, brand_id, brand_name, battery_type, max_speed, weight, status, del_flag, create_by, create_time, update_by, update_time, remark, extend1, extend2, extend3 from zc_car_model
</sql>
<select id="selectZcCarModelList" parameterType="ZcCarModel" resultMap="ZcCarModelResult">
<include refid="selectZcCarModelVo"/>
<where>
<if test="modelName != null and modelName != ''"> and model_name like concat('%', #{modelName}, '%')</if>
<if test="brandName != null and brandName != ''"> and brand_name like concat('%', #{brandName}, '%')</if>
<if test="status != null and status != ''"> and status = #{status}</if>
</where>
</select>
<select id="selectZcCarModelById" parameterType="Long" resultMap="ZcCarModelResult">
<include refid="selectZcCarModelVo"/>
where id = #{id}
</select>
<insert id="insertZcCarModel" parameterType="ZcCarModel" useGeneratedKeys="true" keyProperty="id">
insert into zc_car_model
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="modelName != null and modelName != ''">model_name,</if>
<if test="brandId != null">brand_id,</if>
<if test="brandName != null and brandName != ''">brand_name,</if>
<if test="batteryType != null">battery_type,</if>
<if test="maxSpeed != null">max_speed,</if>
<if test="weight != null">weight,</if>
<if test="status != null">status,</if>
<if test="delFlag != null">del_flag,</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>
<if test="extend1 != null">extend1,</if>
<if test="extend2 != null">extend2,</if>
<if test="extend3 != null">extend3,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="modelName != null and modelName != ''">#{modelName},</if>
<if test="brandId != null">#{brandId},</if>
<if test="brandName != null and brandName != ''">#{brandName},</if>
<if test="batteryType != null">#{batteryType},</if>
<if test="maxSpeed != null">#{maxSpeed},</if>
<if test="weight != null">#{weight},</if>
<if test="status != null">#{status},</if>
<if test="delFlag != null">#{delFlag},</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>
<if test="extend1 != null">#{extend1},</if>
<if test="extend2 != null">#{extend2},</if>
<if test="extend3 != null">#{extend3},</if>
</trim>
</insert>
<update id="updateZcCarModel" parameterType="ZcCarModel">
update zc_car_model
<trim prefix="SET" suffixOverrides=",">
<if test="modelName != null and modelName != ''">model_name = #{modelName},</if>
<if test="brandId != null">brand_id = #{brandId},</if>
<if test="brandName != null and brandName != ''">brand_name = #{brandName},</if>
<if test="batteryType != null">battery_type = #{batteryType},</if>
<if test="maxSpeed != null">max_speed = #{maxSpeed},</if>
<if test="weight != null">weight = #{weight},</if>
<if test="status != null">status = #{status},</if>
<if test="delFlag != null">del_flag = #{delFlag},</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>
<if test="extend1 != null">extend1 = #{extend1},</if>
<if test="extend2 != null">extend2 = #{extend2},</if>
<if test="extend3 != null">extend3 = #{extend3},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteZcCarModelById" parameterType="Long">
delete from zc_car_model where id = #{id}
</delete>
<delete id="deleteZcCarModelByIds" parameterType="String">
delete from zc_car_model where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>