wlzboy
9 小时以前 5f2ee03958a1a16dc27195c76ea7cffb422c95d1
ruoyi-system/src/main/resources/mapper/system/SysTaskVehicleMapper.xml
@@ -16,20 +16,29 @@
        <result property="vehicleType"      column="vehicle_type"     />
        <result property="vehicleBrand"     column="vehicle_brand"    />
        <result property="vehicleModel"     column="vehicle_model"    />
        <result property="deptName"         column="dept_name"        />
        <result property="taskCode"         column="task_code"        />
        <result property="taskType"         column="task_type"        />
    </resultMap>
    <sql id="selectSysTaskVehicleVo">
        select tv.id, tv.task_id, tv.vehicle_id, tv.assign_time, tv.assign_by, tv.status, tv.remark,
               v.vehicle_no, v.vehicle_type, v.vehicle_brand, v.vehicle_model
               v.vehicle_no, v.vehicle_type, v.vehicle_brand, v.vehicle_model, d.dept_name,
               t.task_code, t.task_type
        from sys_task_vehicle tv
        left join tb_vehicle_info v on tv.vehicle_id = v.vehicle_id
        left join tb_vehicle_dept vd on v.vehicle_id = vd.vehicle_id
        left join sys_dept d on vd.dept_id = d.dept_id
        left join sys_task t on tv.task_id = t.task_id
    </sql>
    <select id="selectSysTaskVehicleList" parameterType="SysTaskVehicle" resultMap="SysTaskVehicleResult">
        <include refid="selectSysTaskVehicleVo"/>
        <where>  
            <if test="taskId != null "> and tv.task_id = #{taskId}</if>
            <if test="taskCode != null and taskCode != ''"> and t.task_code like concat('%', #{taskCode}, '%')</if>
            <if test="vehicleId != null "> and tv.vehicle_id = #{vehicleId}</if>
            <if test="vehicleNo != null  and vehicleNo != ''"> and v.vehicle_no like concat('%', #{vehicleNo}, '%')</if>
            <if test="status != null  and status != ''"> and tv.status = #{status}</if>
            <if test="assignBy != null  and assignBy != ''"> and tv.assign_by like concat('%', #{assignBy}, '%')</if>
        </where>
@@ -57,16 +66,16 @@
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="taskId != null">task_id,</if>
            <if test="vehicleId != null">vehicle_id,</if>
            <if test="assignTime != null">assign_time,</if>
            <if test="assignBy != null and assignBy != ''">assign_by,</if>
            assign_time,
            assign_by,
            <if test="status != null and status != ''">status,</if>
            <if test="remark != null">remark,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="taskId != null">#{taskId},</if>
            <if test="vehicleId != null">#{vehicleId},</if>
            <if test="assignTime != null">#{assignTime},</if>
            <if test="assignBy != null and assignBy != ''">#{assignBy},</if>
            #{assignTime},
            #{assignBy},
            <if test="status != null and status != ''">#{status},</if>
            <if test="remark != null">#{remark},</if>
         </trim>
@@ -111,4 +120,4 @@
    <delete id="deleteSysTaskVehicleByTaskIdAndVehicleId">
        delete from sys_task_vehicle where task_id = #{taskId} and vehicle_id = #{vehicleId}
    </delete>
</mapper>
</mapper>