2024-08-01 17:24:41 +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.custom.mapper.CarMainMapper">
|
|
|
|
|
|
2024-08-02 18:31:12 +08:00
|
|
|
<sql id="baseCarMainColumn">
|
|
|
|
|
tbcm.id,
|
|
|
|
|
tbcm.engine_number,
|
|
|
|
|
tbcm.vin,
|
|
|
|
|
tbcm.license_number,
|
|
|
|
|
tbcm.car_model,
|
|
|
|
|
tbcm.maintenance_date,
|
|
|
|
|
tbcm.maintenance_mileage,
|
|
|
|
|
tbcm.inspection_date,
|
|
|
|
|
tbcm.insurance_date,
|
|
|
|
|
tbcm.check_date,
|
|
|
|
|
tbcm.next_maintenance_date,
|
|
|
|
|
tbcm.next_maintenance_mileage,
|
|
|
|
|
tbcm.next_inspection_date,
|
|
|
|
|
tbcm.insurance_expiry_date,
|
|
|
|
|
tbcm.next_check_date,
|
|
|
|
|
tbcm.car_brand,
|
|
|
|
|
tbcm.car_nature,
|
|
|
|
|
tbcm.car_category,
|
|
|
|
|
tbcm.car_register_date,
|
|
|
|
|
tbcm.car_license_img,
|
|
|
|
|
tbcm.recently_handled_business,
|
|
|
|
|
tbcm.recently_handle_business_time,
|
|
|
|
|
tbcm.deleted,
|
|
|
|
|
tbcm.creator,
|
|
|
|
|
tbcm.create_time,
|
|
|
|
|
tbcm.updater,
|
|
|
|
|
tbcm.update_time
|
2024-08-01 17:24:41 +08:00
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="findPage" resultType="cn.iocoder.yudao.module.custom.vo.CarMainRespVO">
|
|
|
|
|
SELECT
|
2024-08-07 19:53:08 +08:00
|
|
|
<include refid="baseCarMainColumn"></include>,bcb.brand_name AS brandStr,bcm.model_name AS modelStr
|
2024-08-02 18:31:12 +08:00
|
|
|
FROM `base_car_main` tbcm
|
2024-08-07 19:53:08 +08:00
|
|
|
left join base_car_brand bcb ON bcb.deleted = 0 AND tbcm.car_brand = bcb.id
|
|
|
|
|
left join base_car_model bcm ON bcm.deleted = 0 AND tbcm.car_model = bcm.id
|
2024-08-01 17:24:41 +08:00
|
|
|
WHERE
|
2024-08-02 18:31:12 +08:00
|
|
|
tbcm.deleted = 0
|
2024-08-01 17:24:41 +08:00
|
|
|
<if test="dto.licenseNumber != null and dto.licenseNumber != ''">
|
2024-08-02 18:31:12 +08:00
|
|
|
AND tbcm.license_number LIKE CONCAT('%',#{dto.licenseNumber},'%')
|
2024-08-01 17:24:41 +08:00
|
|
|
</if>
|
|
|
|
|
<if test="dto.carBrand != null and dto.carBrand != ''">
|
2024-08-02 18:31:12 +08:00
|
|
|
AND tbcm.car_brand = #{dto.carBrand}
|
2024-08-01 17:24:41 +08:00
|
|
|
</if>
|
|
|
|
|
<if test="dto.carCategory != null and dto.carCategory != ''">
|
2024-08-02 18:31:12 +08:00
|
|
|
AND tbcm.car_category = #{dto.carCategory}
|
2024-08-01 17:24:41 +08:00
|
|
|
</if>
|
|
|
|
|
<if test="dto.recentlyHandledBusiness != null and dto.recentlyHandledBusiness != ''">
|
2024-08-02 18:31:12 +08:00
|
|
|
AND tbcm.recently_handled_business = #{dto.recentlyHandledBusiness}
|
2024-08-01 17:24:41 +08:00
|
|
|
</if>
|
|
|
|
|
<if test="dto.recentlyHandleBusinessTime != null">
|
2024-08-02 18:31:12 +08:00
|
|
|
AND tbcm.recently_handle_business_time = #{dto.recentlyHandleBusinessTime}
|
2024-08-01 17:24:41 +08:00
|
|
|
</if>
|
|
|
|
|
<if test="dto.vin != null and dto.vin != ''">
|
2024-08-02 18:31:12 +08:00
|
|
|
AND tbcm.vin LIKE CONCAT('%',#{dto.vin},'%')
|
2024-08-01 17:24:41 +08:00
|
|
|
</if>
|
|
|
|
|
<if test="dto.recentlyHandledBusiness != null and dto.recentlyHandledBusiness != ''">
|
2024-08-02 18:31:12 +08:00
|
|
|
AND tbcm.tenant_id = #{dto.tenant}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="dto.carModel != null and dto.carModel != ''">
|
|
|
|
|
AND tbcm.car_model = #{dto.carModel}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="dto.carNature != null and dto.carNature != ''">
|
|
|
|
|
AND tbcm.car_nature = #{dto.carNature}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="dto.engineNumber != null and dto.engineNumber != ''">
|
|
|
|
|
AND tbcm.engine_number LIKE CONCAT('%',#{dto.engineNumber},'%')
|
|
|
|
|
</if>
|
|
|
|
|
ORDER BY
|
|
|
|
|
tbcm.car_register_date DESC
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="isDataKeyValueRepeat" resultType="cn.iocoder.yudao.module.custom.entity.CarMain">
|
|
|
|
|
SELECT
|
|
|
|
|
tbcm.id
|
|
|
|
|
FROM `base_car_main` tbcm
|
|
|
|
|
WHERE
|
|
|
|
|
tbcm.deleted = 0
|
|
|
|
|
<if test="dto.licenseNumber != null and dto.licenseNumber != ''">
|
|
|
|
|
AND tbcm.license_number = #{dto.licenseNumber}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="dto.vin != null and dto.vin != ''">
|
|
|
|
|
AND tbcm.vin = #{dto.vin}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="dto.engineNumber != null and dto.engineNumber != ''">
|
|
|
|
|
AND tbcm.engine_number = #{dto.engineNumber}
|
2024-08-01 17:24:41 +08:00
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
</select>
|
2024-08-06 17:00:24 +08:00
|
|
|
|
2024-08-01 17:24:41 +08:00
|
|
|
</mapper>
|