|
@@ -1,36 +1,45 @@
|
|
|
<?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">
|
|
|
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.ruoyi.qdtl.mapper.TlElectricCarMileageMapper">
|
|
|
-
|
|
|
+
|
|
|
<resultMap type="TlElectricCarMileage" id="TlElectricCarMileageResult">
|
|
|
- <result property="id" column="id" />
|
|
|
- <result property="imei" column="imei" />
|
|
|
- <result property="deviceName" column="device_name" />
|
|
|
- <result property="days" column="days" />
|
|
|
- <result property="mileage" column="mileage" />
|
|
|
+ <result property="id" column="id"/>
|
|
|
+ <result property="imei" column="imei"/>
|
|
|
+ <result property="deviceName" column="device_name"/>
|
|
|
+ <result property="days" column="days"/>
|
|
|
+ <result property="mileage" column="mileage"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectTlElectricCarMileageVo">
|
|
|
- select id, imei, device_name, days, mileage from tl_electric_car_mileage
|
|
|
+ select id, imei, device_name, days, mileage
|
|
|
+ from tl_electric_car_mileage
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectTlElectricCarMileageList" parameterType="TlElectricCarMileage" resultMap="TlElectricCarMileageResult">
|
|
|
<include refid="selectTlElectricCarMileageVo"/>
|
|
|
- <where>
|
|
|
- <if test="imei != null and imei != ''"> and imei = #{imei}</if>
|
|
|
- <if test="deviceName != null and deviceName != ''"> and device_name like concat('%', #{deviceName}, '%')</if>
|
|
|
- <if test="days != null and days != ''"> and days = #{days}</if>
|
|
|
- <if test="mileage != null and mileage != ''"> and mileage = #{mileage}</if>
|
|
|
+ <where>
|
|
|
+ <if test="imei != null and imei != ''">and imei = #{imei}</if>
|
|
|
+ <if test="deviceName != null and deviceName != ''">and device_name like concat('%', #{deviceName}, '%')</if>
|
|
|
+ <if test="days != null and days != ''">and days = #{days}</if>
|
|
|
+ <if test="mileage != null and mileage != ''">and mileage = #{mileage}</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectTlElectricCarMileageById" parameterType="Long" resultMap="TlElectricCarMileageResult">
|
|
|
<include refid="selectTlElectricCarMileageVo"/>
|
|
|
where id = #{id}
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
+ <select id="queryPeriodDate" resultMap="TlElectricCarMileageResult">
|
|
|
+ <include refid="selectTlElectricCarMileageVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="startDate != null and startDate != ''">and days >= #{startDate}</if>
|
|
|
+ <if test="endDate != null and endDate != ''">and days <= #{endDate}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
<insert id="insertTlElectricCarMileage" parameterType="TlElectricCarMileage" useGeneratedKeys="true" keyProperty="id">
|
|
|
insert into tl_electric_car_mileage
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
@@ -38,13 +47,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="deviceName != null">device_name,</if>
|
|
|
<if test="days != null">days,</if>
|
|
|
<if test="mileage != null">mileage,</if>
|
|
|
- </trim>
|
|
|
+ </trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="imei != null">#{imei},</if>
|
|
|
<if test="deviceName != null">#{deviceName},</if>
|
|
|
<if test="days != null">#{days},</if>
|
|
|
<if test="mileage != null">#{mileage},</if>
|
|
|
- </trim>
|
|
|
+ </trim>
|
|
|
</insert>
|
|
|
|
|
|
<update id="updateTlElectricCarMileage" parameterType="TlElectricCarMileage">
|
|
@@ -59,11 +68,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</update>
|
|
|
|
|
|
<delete id="deleteTlElectricCarMileageById" parameterType="Long">
|
|
|
- delete from tl_electric_car_mileage where id = #{id}
|
|
|
+ delete
|
|
|
+ from tl_electric_car_mileage
|
|
|
+ where id = #{id}
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteTlElectricCarMileageByIds" parameterType="String">
|
|
|
- delete from tl_electric_car_mileage where id in
|
|
|
+ delete from tl_electric_car_mileage where id in
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
#{id}
|
|
|
</foreach>
|