159 lines
9.1 KiB
XML
159 lines
9.1 KiB
XML
<?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.ZcCarDamageMapper">
|
|
|
|
<resultMap type="ZcCarDamage" id="ZcCarDamageResult">
|
|
<result property="id" column="id" />
|
|
<result property="carId" column="car_id" />
|
|
<result property="damageType" column="damage_type" />
|
|
<result property="damageReason" column="damage_reason" />
|
|
<result property="submitterName" column="submitter_name" />
|
|
<result property="submitTime" column="submit_time" />
|
|
<result property="damageStatus" column="damage_status" />
|
|
<result property="auditorName" column="auditor_name" />
|
|
<result property="auditTime" column="audit_time" />
|
|
<result property="auditComment" column="audit_comment" />
|
|
<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" />
|
|
|
|
<association property="zcCar" column="car_id" javaType="ZcCar" resultMap="zcCarResult" />
|
|
</resultMap>
|
|
|
|
<resultMap id="zcCarResult" type="ZcCar">
|
|
<result property="vin" column="vin" />
|
|
<result property="licensePlate" column="license_plate" />
|
|
<result property="brandName" column="brand_name" />
|
|
<result property="modelName" column="model_name" />
|
|
<result property="purchasePrice" column="purchase_price" />
|
|
<result property="belongType" column="belong_type" />
|
|
<result property="operatorName" column="operator_name" />
|
|
<result property="storeName" column="store_name" />
|
|
</resultMap>
|
|
|
|
<sql id="selectZcCarDamageVo">
|
|
select a.id, a.car_id, a.damage_type, a.damage_reason, a.submitter_name, a.submit_time, a.damage_status, a.auditor_name, a.audit_time, a.audit_comment, a.status, a.del_flag, a.create_by, a.create_time, a.update_by, a.update_time, a.remark, a.extend1, a.extend2, a.extend3,
|
|
c.vin, c.license_plate, c.brand_name, c.model_name, c.purchase_price, c.belong_type, c.operator_name, c.store_name
|
|
from zc_car_damage a
|
|
left join zc_car c on a.car_id = c.id
|
|
</sql>
|
|
|
|
<select id="selectZcCarDamageList" parameterType="ZcCarDamage" resultMap="ZcCarDamageResult">
|
|
<include refid="selectZcCarDamageVo"/>
|
|
<where>
|
|
<if test="carId != null "> and a.car_id = #{carId}</if>
|
|
<if test="damageType != null and damageType != ''"> and a.damage_type = #{damageType}</if>
|
|
<if test="damageReason != null and damageReason != ''"> and a.damage_reason = #{damageReason}</if>
|
|
<if test="submitterName != null and submitterName != ''"> and a.submitter_name like concat('%', #{submitterName}, '%')</if>
|
|
<if test="submitTime != null "> and a.submit_time = #{submitTime}</if>
|
|
<if test="damageStatus != null "> and a.damage_status = #{damageStatus}</if>
|
|
<if test="auditorName != null and auditorName != ''"> and a.auditor_name like concat('%', #{auditorName}, '%')</if>
|
|
<if test="auditTime != null "> and a.audit_time = #{auditTime}</if>
|
|
<if test="auditComment != null and auditComment != ''"> and a.audit_comment = #{auditComment}</if>
|
|
<if test="status != null and status != ''"> and a.status = #{status}</if>
|
|
<if test="extend1 != null and extend1 != ''"> and a.extend1 = #{extend1}</if>
|
|
<if test="extend2 != null and extend2 != ''"> and a.extend2 = #{extend2}</if>
|
|
<if test="extend3 != null and extend3 != ''"> and a.extend3 = #{extend3}</if>
|
|
<if test="operatorId != null "> and c.operator_id = #{operatorId}</if>
|
|
<if test="storeName != null "> and c.store_name = #{storeName}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectZcCarDamageById" parameterType="Long" resultMap="ZcCarDamageResult">
|
|
<include refid="selectZcCarDamageVo"/>
|
|
where a.id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertZcCarDamage" parameterType="ZcCarDamage" useGeneratedKeys="true" keyProperty="id">
|
|
insert into zc_car_damage
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="carId != null">car_id,</if>
|
|
<if test="damageType != null and damageType != ''">damage_type,</if>
|
|
<if test="damageReason != null">damage_reason,</if>
|
|
<if test="submitterName != null and submitterName != ''">submitter_name,</if>
|
|
<if test="submitTime != null">submit_time,</if>
|
|
<if test="damageStatus != null">damage_status,</if>
|
|
<if test="auditorName != null">auditor_name,</if>
|
|
<if test="auditTime != null">audit_time,</if>
|
|
<if test="auditComment != null">audit_comment,</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="carId != null">#{carId},</if>
|
|
<if test="damageType != null and damageType != ''">#{damageType},</if>
|
|
<if test="damageReason != null">#{damageReason},</if>
|
|
<if test="submitterName != null and submitterName != ''">#{submitterName},</if>
|
|
<if test="submitTime != null">#{submitTime},</if>
|
|
<if test="damageStatus != null">#{damageStatus},</if>
|
|
<if test="auditorName != null">#{auditorName},</if>
|
|
<if test="auditTime != null">#{auditTime},</if>
|
|
<if test="auditComment != null">#{auditComment},</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="updateZcCarDamage" parameterType="ZcCarDamage">
|
|
update zc_car_damage
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="carId != null">car_id = #{carId},</if>
|
|
<if test="damageType != null and damageType != ''">damage_type = #{damageType},</if>
|
|
<if test="damageReason != null">damage_reason = #{damageReason},</if>
|
|
<if test="submitterName != null and submitterName != ''">submitter_name = #{submitterName},</if>
|
|
<if test="submitTime != null">submit_time = #{submitTime},</if>
|
|
<if test="damageStatus != null">damage_status = #{damageStatus},</if>
|
|
<if test="auditorName != null">auditor_name = #{auditorName},</if>
|
|
<if test="auditTime != null">audit_time = #{auditTime},</if>
|
|
<if test="auditComment != null">audit_comment = #{auditComment},</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="deleteZcCarDamageById" parameterType="Long">
|
|
delete from zc_car_damage where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteZcCarDamageByIds" parameterType="String">
|
|
delete from zc_car_damage where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
|
|
</mapper> |