2024-08-16 13:32:42 +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="cn.iocoder.yudao.module.rescue.mapper.RescueCarInfoMapper">
|
|
|
|
|
|
|
|
<resultMap type="cn.iocoder.yudao.module.rescue.domain.RescueCarInfo" id="RescueCarInfoResult">
|
2024-08-19 19:14:41 +08:00
|
|
|
<result property="id" column="id"/>
|
|
|
|
<result property="rescueCarType" column="rescue_car_type"/>
|
|
|
|
<result property="rescueCarNum" column="rescue_car_num"/>
|
|
|
|
<result property="rescueCarBrand" column="rescue_car_brand"/>
|
|
|
|
<result property="carOwn" column="car_own"/>
|
|
|
|
<result property="carImage" column="car_image"/>
|
|
|
|
<result property="driveLicenseImage" column="drive_license_image"/>
|
|
|
|
<result property="carBuyTime" column="car_buy_time"/>
|
|
|
|
<result property="carLicenseColor" column="car_license_color"/>
|
|
|
|
<result property="carUseNature" column="car_use_nature"/>
|
|
|
|
<result property="frameNumber" column="frame_number"/>
|
|
|
|
<result property="carKeepTime" column="car_keep_time"/>
|
|
|
|
<result property="carInsuranceTime" column="car_insurance_time"/>
|
|
|
|
<result property="carCheckTime" column="car_check_time"/>
|
|
|
|
<result property="possessorId" column="possessor_id"/>
|
2025-08-29 17:20:27 +08:00
|
|
|
<result property="carCategory" column="car_category"/>
|
2024-08-16 13:32:42 +08:00
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<sql id="selectRescueCarInfoVo">
|
2024-08-19 19:14:41 +08:00
|
|
|
SELECT rci.id,
|
|
|
|
rci.rescue_car_type,
|
|
|
|
rci.rescue_car_num,
|
|
|
|
rci.rescue_car_brand,
|
|
|
|
rci.car_own,
|
|
|
|
rci.car_image,
|
|
|
|
rci.drive_license_image,
|
|
|
|
rci.car_buy_time,
|
|
|
|
rci.car_license_color,
|
|
|
|
rci.car_use_nature,
|
|
|
|
rci.frame_number,
|
|
|
|
rci.car_keep_time,
|
|
|
|
rci.car_insurance_time,
|
|
|
|
rci.car_check_time,
|
2025-08-29 17:20:27 +08:00
|
|
|
rci.possessor_id,
|
|
|
|
rci.car_category
|
2024-08-19 19:14:41 +08:00
|
|
|
FROM rescue_car_info rci
|
|
|
|
where rci.deleted = '0'
|
2024-08-16 13:32:42 +08:00
|
|
|
</sql>
|
|
|
|
|
2024-08-19 19:14:41 +08:00
|
|
|
<select id="selectRescueCarInfoList" parameterType="cn.iocoder.yudao.module.rescue.domain.RescueCarInfo"
|
|
|
|
resultType="cn.iocoder.yudao.module.rescue.domain.RescueCarInfo">
|
2024-08-16 13:32:42 +08:00
|
|
|
<include refid="selectRescueCarInfoVo"/>
|
2024-08-19 19:14:41 +08:00
|
|
|
<if test="map.rescueCarType != null and map.rescueCarType != ''">and rci.rescue_car_type =
|
|
|
|
#{map.rescueCarType}
|
|
|
|
</if>
|
|
|
|
<if test="map.rescueCarNum != null and map.rescueCarNum != ''">and rci.rescue_car_num = #{map.rescueCarNum}
|
|
|
|
</if>
|
|
|
|
<if test="map.rescueCarBrand != null and map.rescueCarBrand != ''">and rci.rescue_car_brand =
|
|
|
|
#{map.rescueCarBrand}
|
|
|
|
</if>
|
|
|
|
<if test="map.carOwn != null and map.carOwn != ''">and rci.car_own = #{map.carOwn}</if>
|
|
|
|
<if test="map.carImage != null and map.carImage != ''">and rci.car_image = #{map.carImage}</if>
|
|
|
|
<if test="map.driveLicenseImage != null and map.driveLicenseImage != ''">and rci.drive_license_image =
|
|
|
|
#{map.driveLicenseImage}
|
|
|
|
</if>
|
|
|
|
<if test="map.carBuyTime != null ">and rci.car_buy_time = #{map.carBuyTime}</if>
|
|
|
|
<if test="map.carLicenseColor != null and map.carLicenseColor != ''">and rci.car_license_color =
|
|
|
|
#{map.carLicenseColor}
|
|
|
|
</if>
|
|
|
|
<if test="map.carUseNature != null and map.carUseNature != ''">and rci.car_use_nature = #{map.carUseNature}
|
|
|
|
</if>
|
|
|
|
<if test="map.frameNumber != null and map.frameNumber != ''">and rci.frame_number = #{map.frameNumber}</if>
|
|
|
|
<if test="map.possessorId != null ">and rci.possessor_id = #{map.possessorId}</if>
|
2024-08-16 13:32:42 +08:00
|
|
|
order by rci.create_time desc
|
|
|
|
</select>
|
|
|
|
|
2024-08-19 19:14:41 +08:00
|
|
|
<select id="selectRescueCarInfoById" resultType="cn.iocoder.yudao.module.rescue.domain.RescueCarInfo">
|
2024-08-16 13:32:42 +08:00
|
|
|
<include refid="selectRescueCarInfoVo"/>
|
2024-08-19 19:14:41 +08:00
|
|
|
AND id = #{id}
|
2024-08-16 13:32:42 +08:00
|
|
|
</select>
|
|
|
|
|
|
|
|
|
2024-08-19 19:14:41 +08:00
|
|
|
<insert id="insertRescueCarInfo" parameterType="cn.iocoder.yudao.module.rescue.domain.RescueCarInfo"
|
|
|
|
useGeneratedKeys="true" keyProperty="id">
|
2024-08-16 13:32:42 +08:00
|
|
|
insert into rescue_car_info
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="rescueCarType != null">rescue_car_type,</if>
|
|
|
|
<if test="rescueCarNum != null">rescue_car_num,</if>
|
|
|
|
<if test="rescueCarBrand != null">rescue_car_brand,</if>
|
|
|
|
<if test="carOwn != null">car_own,</if>
|
|
|
|
<if test="carImage != null">car_image,</if>
|
|
|
|
<if test="driveLicenseImage != null">drive_license_image,</if>
|
|
|
|
<if test="carBuyTime != null">car_buy_time,</if>
|
|
|
|
<if test="carLicenseColor != null">car_license_color,</if>
|
|
|
|
<if test="carUseNature != null">car_use_nature,</if>
|
|
|
|
<if test="frameNumber != null">frame_number,</if>
|
|
|
|
<if test="carKeepTime != null">car_keep_time,</if>
|
|
|
|
<if test="carInsuranceTime != null">car_insurance_time,</if>
|
|
|
|
<if test="carCheckTime != null">car_check_time,</if>
|
|
|
|
<if test="possessorId != null">possessor_id,</if>
|
2025-08-29 17:20:27 +08:00
|
|
|
<if test="carCategory != null">car_category,</if>
|
2024-08-16 13:32:42 +08:00
|
|
|
</trim>
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="rescueCarType != null">#{rescueCarType},</if>
|
|
|
|
<if test="rescueCarNum != null">#{rescueCarNum},</if>
|
|
|
|
<if test="rescueCarBrand != null">#{rescueCarBrand},</if>
|
|
|
|
<if test="carOwn != null">#{carOwn},</if>
|
|
|
|
<if test="carImage != null">#{carImage},</if>
|
|
|
|
<if test="driveLicenseImage != null">#{driveLicenseImage},</if>
|
|
|
|
<if test="carBuyTime != null">#{carBuyTime},</if>
|
|
|
|
<if test="carLicenseColor != null">#{carLicenseColor},</if>
|
|
|
|
<if test="carUseNature != null">#{carUseNature},</if>
|
|
|
|
<if test="frameNumber != null">#{frameNumber},</if>
|
|
|
|
<if test="carKeepTime != null">#{carKeepTime},</if>
|
|
|
|
<if test="carInsuranceTime != null">#{carInsuranceTime},</if>
|
|
|
|
<if test="carCheckTime != null">#{carCheckTime},</if>
|
|
|
|
<if test="possessorId != null">#{possessorId},</if>
|
2025-08-29 17:20:27 +08:00
|
|
|
<if test="carCategory != null">#{carCategory},</if>
|
2024-08-16 13:32:42 +08:00
|
|
|
</trim>
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
<update id="updateRescueCarInfo" parameterType="cn.iocoder.yudao.module.rescue.domain.RescueCarInfo">
|
|
|
|
update rescue_car_info
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
<if test="rescueCarType != null">rescue_car_type = #{rescueCarType},</if>
|
|
|
|
<if test="rescueCarNum != null">rescue_car_num = #{rescueCarNum},</if>
|
|
|
|
<if test="rescueCarBrand != null">rescue_car_brand = #{rescueCarBrand},</if>
|
|
|
|
<if test="carOwn != null">car_own = #{carOwn},</if>
|
|
|
|
<if test="carImage != null">car_image = #{carImage},</if>
|
|
|
|
<if test="driveLicenseImage != null">drive_license_image = #{driveLicenseImage},</if>
|
|
|
|
<if test="carBuyTime != null">car_buy_time = #{carBuyTime},</if>
|
|
|
|
<if test="carLicenseColor != null">car_license_color = #{carLicenseColor},</if>
|
|
|
|
<if test="carUseNature != null">car_use_nature = #{carUseNature},</if>
|
|
|
|
<if test="frameNumber != null">frame_number = #{frameNumber},</if>
|
|
|
|
<if test="carKeepTime != null">car_keep_time = #{carKeepTime},</if>
|
|
|
|
<if test="carInsuranceTime != null">car_insurance_time = #{carInsuranceTime},</if>
|
|
|
|
<if test="carCheckTime != null">car_check_time = #{carCheckTime},</if>
|
|
|
|
<if test="possessorId != null">possessor_id = #{possessorId},</if>
|
2025-08-29 17:20:27 +08:00
|
|
|
<if test="carCategory != null">car_category = #{carCategory},</if>
|
2024-08-16 13:32:42 +08:00
|
|
|
</trim>
|
|
|
|
where id = #{id}
|
|
|
|
</update>
|
|
|
|
|
2025-08-29 17:20:27 +08:00
|
|
|
<update id="updateRescueCarInfoNew" parameterType="cn.iocoder.yudao.module.rescue.domain.RescueCarInfo">
|
|
|
|
update rescue_car_info
|
|
|
|
SET possessor_id = #{possessorId}
|
|
|
|
where id = #{id}
|
|
|
|
</update>
|
|
|
|
|
2024-08-19 19:14:41 +08:00
|
|
|
<delete id="deleteRescueCarInfoById">
|
|
|
|
delete
|
|
|
|
from rescue_car_info
|
|
|
|
where id = #{id}
|
2024-08-16 13:32:42 +08:00
|
|
|
</delete>
|
|
|
|
|
2024-08-19 19:14:41 +08:00
|
|
|
<delete id="deleteRescueCarInfoByIds">
|
2024-08-16 13:32:42 +08:00
|
|
|
delete from rescue_car_info where id in
|
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
#{id}
|
|
|
|
</foreach>
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="warnListBy" resultType="cn.iocoder.yudao.module.rescue.domain.RescueCarInfo">
|
2024-08-19 19:14:41 +08:00
|
|
|
SELECT *
|
|
|
|
FROM `rescue_car_info`
|
|
|
|
where car_keep_time <![CDATA[<]]> #{warnTime}
|
2024-08-16 13:32:42 +08:00
|
|
|
|
|
|
|
</select>
|
|
|
|
<select id="warnListBx" resultType="cn.iocoder.yudao.module.rescue.domain.RescueCarInfo">
|
2024-08-19 19:14:41 +08:00
|
|
|
SELECT *
|
|
|
|
FROM `rescue_car_info`
|
|
|
|
where car_insurance_time <![CDATA[<]]> #{warnTime}
|
2024-08-16 13:32:42 +08:00
|
|
|
</select>
|
|
|
|
<select id="warnListNj" resultType="cn.iocoder.yudao.module.rescue.domain.RescueCarInfo">
|
2024-08-19 19:14:41 +08:00
|
|
|
SELECT *
|
|
|
|
FROM `rescue_car_info`
|
|
|
|
where car_check_time <![CDATA[<]]> #{warnTime}
|
2024-08-16 13:32:42 +08:00
|
|
|
</select>
|
2024-10-24 18:05:58 +08:00
|
|
|
<select id="selectRescueCarEarlyWarning" resultType="java.util.Map">
|
|
|
|
SELECT
|
|
|
|
rescue_car_num AS carNum,
|
|
|
|
rescue_car_brand AS carBrand,
|
|
|
|
<if test="type == 'keep'">
|
|
|
|
DATEDIFF(CURRENT_DATE, car_keep_time) AS day
|
|
|
|
</if>
|
|
|
|
<if test="type == 'insurance'">
|
|
|
|
DATEDIFF(CURRENT_DATE, car_insurance_time) AS day
|
|
|
|
</if>
|
|
|
|
<if test="type == 'check'">
|
|
|
|
DATEDIFF(CURRENT_DATE, car_check_time) AS day
|
|
|
|
</if>
|
|
|
|
FROM
|
|
|
|
rescue_car_info
|
|
|
|
ORDER BY
|
|
|
|
day DESC
|
|
|
|
</select>
|
2025-08-29 17:20:27 +08:00
|
|
|
|
|
|
|
<select id="getNoAllocationCar" resultType="cn.iocoder.yudao.module.rescue.domain.RescueCarInfo">
|
|
|
|
SELECT *
|
|
|
|
FROM `rescue_car_info`
|
|
|
|
WHERE possessor_id IS NULL
|
|
|
|
AND deleted = 0
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="getAllCar" resultType="cn.iocoder.yudao.module.rescue.domain.RescueCarInfo">
|
|
|
|
SELECT *
|
|
|
|
FROM `rescue_car_info`
|
|
|
|
WHERE deleted = 0
|
|
|
|
</select>
|
2024-08-16 13:32:42 +08:00
|
|
|
</mapper>
|