123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- <?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.miniapp.bus.mapper.BasicVehicleMapper">
-
- <resultMap type="com.miniapp.bus.domain.BasicVehicle" id="BasicVehicleResult">
- <result property="id" column="id" />
- <result property="carnumber" column="carnumber" />
- <result property="vehicleType" column="vehicle_type" />
- <result property="deadweight" column="deadweight" />
- <result property="contact" column="contact" />
- <result property="telephone" column="telephone" />
- <result property="bow" column="bow" />
- <result property="certificate" column="certificate" />
- <result property="deltag" column="deltag" />
- <result property="filepath" column="filepath" />
- <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="selectBasicVehicleVo">
- select id, carnumber, vehicle_type, deadweight, contact, telephone, bow, certificate, deltag, filepath, create_by, create_time, update_by, update_time, remark from basic_vehicle
- </sql>
- <select id="selectBasicVehicleList" parameterType="BasicVehicle" resultMap="BasicVehicleResult">
- <include refid="selectBasicVehicleVo"/>
- <where>
- <if test="carnumber != null and carnumber != ''"> and carnumber = #{carnumber}</if>
- <if test="vehicleType != null and vehicleType != ''"> and vehicle_type = #{vehicleType}</if>
- <if test="deadweight != null "> and deadweight = #{deadweight}</if>
- <if test="contact != null and contact != ''"> and contact = #{contact}</if>
- <if test="telephone != null and telephone != ''"> and telephone = #{telephone}</if>
- <if test="bow != null and bow != ''"> and bow = #{bow}</if>
- <if test="certificate != null and certificate != ''"> and certificate = #{certificate}</if>
- <if test="deltag != null and deltag != ''"> and deltag = #{deltag}</if>
- <if test="filepath != null and filepath != ''"> and filepath = #{filepath}</if>
- </where>
- </select>
-
- <select id="selectBasicVehicleById" parameterType="Long" resultMap="BasicVehicleResult">
- <include refid="selectBasicVehicleVo"/>
- where id = #{id}
- </select>
- <insert id="insertBasicVehicle" parameterType="BasicVehicle" useGeneratedKeys="true" keyProperty="id">
- insert into basic_vehicle
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="carnumber != null">carnumber,</if>
- <if test="vehicleType != null">vehicle_type,</if>
- <if test="deadweight != null">deadweight,</if>
- <if test="contact != null">contact,</if>
- <if test="telephone != null">telephone,</if>
- <if test="bow != null">bow,</if>
- <if test="certificate != null">certificate,</if>
- <if test="deltag != null">deltag,</if>
- <if test="filepath != null">filepath,</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="carnumber != null">#{carnumber},</if>
- <if test="vehicleType != null">#{vehicleType},</if>
- <if test="deadweight != null">#{deadweight},</if>
- <if test="contact != null">#{contact},</if>
- <if test="telephone != null">#{telephone},</if>
- <if test="bow != null">#{bow},</if>
- <if test="certificate != null">#{certificate},</if>
- <if test="deltag != null">#{deltag},</if>
- <if test="filepath != null">#{filepath},</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>
- <update id="updateBasicVehicle" parameterType="BasicVehicle">
- update basic_vehicle
- <trim prefix="SET" suffixOverrides=",">
- <if test="carnumber != null">carnumber = #{carnumber},</if>
- <if test="vehicleType != null">vehicle_type = #{vehicleType},</if>
- <if test="deadweight != null">deadweight = #{deadweight},</if>
- <if test="contact != null">contact = #{contact},</if>
- <if test="telephone != null">telephone = #{telephone},</if>
- <if test="bow != null">bow = #{bow},</if>
- <if test="certificate != null">certificate = #{certificate},</if>
- <if test="deltag != null">deltag = #{deltag},</if>
- <if test="filepath != null">filepath = #{filepath},</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 id = #{id}
- </update>
- <delete id="deleteBasicVehicleById" parameterType="Long">
- delete from basic_vehicle where id = #{id}
- </delete>
- <delete id="deleteBasicVehicleByIds" parameterType="String">
- delete from basic_vehicle where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|