You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
212 lines
13 KiB
XML
212 lines
13 KiB
XML
|
2 weeks ago
|
<?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.system.mapper.BizMaintenanceOrderMapper">
|
||
|
|
|
||
|
|
<resultMap type="BizMaintenanceOrder" id="BizMaintenanceOrderResult">
|
||
|
|
<result property="orderId" column="order_id" />
|
||
|
|
<result property="orderNo" column="order_no" />
|
||
|
|
<result property="vehicleId" column="vehicle_id" />
|
||
|
|
<result property="plateNumber" column="plate_number" />
|
||
|
|
<result property="typeCode" column="type_code" />
|
||
|
|
<result property="factoryId" column="factory_id" />
|
||
|
|
<result property="inputMileage" column="input_mileage" />
|
||
|
|
<result property="lastMileage" column="last_mileage" />
|
||
|
|
<result property="maintainDate" column="maintain_date" />
|
||
|
|
<result property="description" column="description" />
|
||
|
|
<result property="status" column="status" />
|
||
|
|
<result property="orderType" column="order_type" />
|
||
|
|
<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="factoryName" column="factory_name" />
|
||
|
|
<result property="maintainer" column="maintainer" />
|
||
|
|
<result property="maintainerDate" column="maintainer_date" />
|
||
|
|
</resultMap>
|
||
|
|
|
||
|
|
<sql id="selectBizMaintenanceOrderVo">
|
||
|
|
select order_id, order_no, vehicle_id, plate_number, type_code, factory_id, input_mileage, last_mileage, maintain_date, description, status, order_type, create_by, create_time, update_by, update_time, remark from biz_maintenance_order
|
||
|
|
</sql>
|
||
|
|
|
||
|
|
<select id="selectBizMaintenanceOrderList" parameterType="BizMaintenanceOrder" resultMap="BizMaintenanceOrderResult">
|
||
|
|
select o.order_id, o.order_no, o.vehicle_id, o.plate_number, o.type_code, o.factory_id, o.input_mileage, o.last_mileage, o.maintain_date, o.description, o.status, o.order_type, o.create_by, o.create_time, o.update_by, o.update_time, o.remark, d.dept_name as factory_name
|
||
|
|
from biz_maintenance_order o
|
||
|
|
left join sys_dept d on d.dept_id = o.factory_id
|
||
|
|
<where>
|
||
|
|
<if test="orderNo != null and orderNo != ''"> and o.order_no like concat('%', #{orderNo}, '%')</if>
|
||
|
|
<if test="plateNumber != null and plateNumber != ''"> and o.plate_number like concat('%', #{plateNumber}, '%')</if>
|
||
|
|
<if test="typeCode != null and typeCode != ''"> and o.type_code = #{typeCode}</if>
|
||
|
|
<if test="factoryId != null "> and o.factory_id = #{factoryId}</if>
|
||
|
|
<if test="inputMileage != null "> and o.input_mileage = #{inputMileage}</if>
|
||
|
|
<if test="lastMileage != null "> and o.last_mileage = #{lastMileage}</if>
|
||
|
|
<if test="maintainDate != null "> and o.maintain_date = #{maintainDate}</if>
|
||
|
|
<if test="description != null and description != ''"> and o.description like concat('%', #{description}, '%')</if>
|
||
|
|
<if test="status != null and status != ''"> and o.status = #{status}</if>
|
||
|
|
<if test="orderType != null and orderType != ''"> and o.order_type = #{orderType}</if>
|
||
|
|
<!-- 按照补胎工单查询 -->
|
||
|
|
<if test="orderType == null or orderType == ''"> and o.order_type = '1'</if>
|
||
|
|
${params.dataScope}
|
||
|
|
</where>
|
||
|
|
order by o.create_time desc
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="selectBizRepairOrderList" parameterType="BizMaintenanceOrder" resultMap="BizMaintenanceOrderResult">
|
||
|
|
select o.order_id, o.order_no, o.vehicle_id, o.plate_number, o.type_code, o.factory_id, o.input_mileage, o.last_mileage, o.maintain_date, o.description, o.status, o.order_type, o.create_by, o.create_time, o.update_by, o.update_time, o.remark, d.dept_name as factory_name
|
||
|
|
from biz_maintenance_order o
|
||
|
|
left join sys_dept d on d.dept_id = o.factory_id
|
||
|
|
<where>
|
||
|
|
and o.type_code in ('1','2','4','5')
|
||
|
|
<if test="orderNo != null and orderNo != ''"> and o.order_no like concat('%', #{orderNo}, '%')</if>
|
||
|
|
<if test="plateNumber != null and plateNumber != ''"> and o.plate_number like concat('%', #{plateNumber}, '%')</if>
|
||
|
|
<if test="typeCode != null and typeCode != ''"> and o.type_code = #{typeCode}</if>
|
||
|
|
<if test="factoryId != null "> and o.factory_id = #{factoryId}</if>
|
||
|
|
<if test="inputMileage != null "> and o.input_mileage = #{inputMileage}</if>
|
||
|
|
<if test="lastMileage != null "> and o.last_mileage = #{lastMileage}</if>
|
||
|
|
<if test="maintainDate != null "> and o.maintain_date = #{maintainDate}</if>
|
||
|
|
<if test="description != null and description != ''"> and o.description like concat('%', #{description}, '%')</if>
|
||
|
|
<if test="status != null and status != ''"> and o.status = #{status}</if>
|
||
|
|
<if test="orderType != null and orderType != ''"> and o.order_type = #{orderType}</if>
|
||
|
|
<!-- 按照补胎工单查询 -->
|
||
|
|
<if test="orderType == null or orderType == ''"> and o.order_type = '1'</if>
|
||
|
|
${params.dataScope}
|
||
|
|
</where>
|
||
|
|
order by o.create_time desc
|
||
|
|
</select>
|
||
|
|
|
||
|
|
|
||
|
|
<select id="selectBizScrapOrderList" parameterType="BizMaintenanceOrder" resultMap="BizMaintenanceOrderResult">
|
||
|
|
select o.order_id, o.order_no, o.vehicle_id, o.plate_number, o.type_code, o.factory_id, o.input_mileage, o.last_mileage, o.maintain_date, o.description, o.status, o.order_type, o.create_by, o.create_time, o.update_by, o.update_time, o.remark, d.dept_name as factory_name
|
||
|
|
from biz_maintenance_order o
|
||
|
|
left join sys_dept d on d.dept_id = o.factory_id
|
||
|
|
<where>
|
||
|
|
and o.type_code = '3'
|
||
|
|
<if test="orderNo != null and orderNo != ''"> and o.order_no like concat('%', #{orderNo}, '%')</if>
|
||
|
|
<if test="plateNumber != null and plateNumber != ''"> and o.plate_number like concat('%', #{plateNumber}, '%')</if>
|
||
|
|
<if test="typeCode != null and typeCode != ''"> and o.type_code = #{typeCode}</if>
|
||
|
|
<if test="factoryId != null "> and o.factory_id = #{factoryId}</if>
|
||
|
|
<if test="inputMileage != null "> and o.input_mileage = #{inputMileage}</if>
|
||
|
|
<if test="lastMileage != null "> and o.last_mileage = #{lastMileage}</if>
|
||
|
|
<if test="maintainDate != null "> and o.maintain_date = #{maintainDate}</if>
|
||
|
|
<if test="description != null and description != ''"> and o.description like concat('%', #{description}, '%')</if>
|
||
|
|
<if test="status != null and status != ''"> and o.status = #{status}</if>
|
||
|
|
<if test="orderType != null and orderType != ''"> and o.order_type = #{orderType}</if>
|
||
|
|
<!-- 按照补胎工单查询 -->
|
||
|
|
<if test="orderType == null or orderType == ''"> and o.order_type = '1'</if>
|
||
|
|
${params.dataScope}
|
||
|
|
</where>
|
||
|
|
order by o.create_time desc
|
||
|
|
</select>
|
||
|
|
|
||
|
|
|
||
|
|
<select id="selectBizMaintenanceOrderById" parameterType="Long" resultMap="BizMaintenanceOrderResult">
|
||
|
|
select o.order_id, o.order_no, o.vehicle_id, o.plate_number, o.type_code, o.factory_id, o.input_mileage, o.last_mileage, o.maintain_date, o.description, o.status, o.order_type, o.create_by, o.create_time, o.update_by, o.update_time, o.remark, d.dept_name as factory_name
|
||
|
|
from biz_maintenance_order o
|
||
|
|
left join sys_dept d on d.dept_id = o.factory_id
|
||
|
|
where o.order_id = #{orderId}
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<insert id="insertBizMaintenanceOrder" parameterType="BizMaintenanceOrder" useGeneratedKeys="true" keyProperty="orderId">
|
||
|
|
insert into biz_maintenance_order
|
||
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="orderNo != null">order_no,</if>
|
||
|
|
<if test="vehicleId != null">vehicle_id,</if>
|
||
|
|
<if test="plateNumber != null">plate_number,</if>
|
||
|
|
<if test="typeCode != null">type_code,</if>
|
||
|
|
<if test="factoryId != null">factory_id,</if>
|
||
|
|
<if test="inputMileage != null">input_mileage,</if>
|
||
|
|
<if test="lastMileage != null">last_mileage,</if>
|
||
|
|
<if test="maintainDate != null">maintain_date,</if>
|
||
|
|
<if test="description != null">description,</if>
|
||
|
|
<if test="status != null">status,</if>
|
||
|
|
<if test="orderType != null">order_type,</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="maintainer != null">maintainer,</if>
|
||
|
|
<if test="maintainerDate != null">maintainer_date,</if>
|
||
|
|
</trim>
|
||
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="orderNo != null">#{orderNo},</if>
|
||
|
|
<if test="vehicleId != null">#{vehicleId},</if>
|
||
|
|
<if test="plateNumber != null">#{plateNumber},</if>
|
||
|
|
<if test="typeCode != null">#{typeCode},</if>
|
||
|
|
<if test="factoryId != null">#{factoryId},</if>
|
||
|
|
<if test="inputMileage != null">#{inputMileage},</if>
|
||
|
|
<if test="lastMileage != null">#{lastMileage},</if>
|
||
|
|
<if test="maintainDate != null">#{maintainDate},</if>
|
||
|
|
<if test="description != null">#{description},</if>
|
||
|
|
<if test="status != null">#{status},</if>
|
||
|
|
<if test="orderType != null">#{orderType},</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="maintainer != null">#{maintainer},</if>
|
||
|
|
<if test="maintainerDate != null">#{maintainerDate},</if>
|
||
|
|
</trim>
|
||
|
|
</insert>
|
||
|
|
|
||
|
|
<update id="updateBizMaintenanceOrder" parameterType="BizMaintenanceOrder">
|
||
|
|
update biz_maintenance_order
|
||
|
|
<trim prefix="SET" suffixOverrides=",">
|
||
|
|
<if test="orderNo != null">order_no = #{orderNo},</if>
|
||
|
|
<if test="vehicleId != null">vehicle_id = #{vehicleId},</if>
|
||
|
|
<if test="plateNumber != null">plate_number = #{plateNumber},</if>
|
||
|
|
<if test="typeCode != null">type_code = #{typeCode},</if>
|
||
|
|
<if test="factoryId != null">factory_id = #{factoryId},</if>
|
||
|
|
<if test="inputMileage != null">input_mileage = #{inputMileage},</if>
|
||
|
|
<if test="lastMileage != null">last_mileage = #{lastMileage},</if>
|
||
|
|
<if test="maintainDate != null">maintain_date = #{maintainDate},</if>
|
||
|
|
<if test="description != null">description = #{description},</if>
|
||
|
|
<if test="status != null">status = #{status},</if>
|
||
|
|
<if test="orderType != null">order_type = #{orderType},</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="maintainer != null">maintainer = #{maintainer},</if>
|
||
|
|
<if test="maintainerDate != null">maintainer_date = #{maintainerDate},</if>
|
||
|
|
</trim>
|
||
|
|
where order_id = #{orderId}
|
||
|
|
</update>
|
||
|
|
|
||
|
|
<delete id="deleteBizMaintenanceOrderById" parameterType="Long">
|
||
|
|
delete from biz_maintenance_order where order_id = #{orderId}
|
||
|
|
</delete>
|
||
|
|
|
||
|
|
<delete id="deleteBizMaintenanceOrderByIds" parameterType="String">
|
||
|
|
delete from biz_maintenance_order where order_id in
|
||
|
|
<foreach item="orderId" collection="array" open="(" separator="," close=")">
|
||
|
|
#{orderId}
|
||
|
|
</foreach>
|
||
|
|
</delete>
|
||
|
|
|
||
|
|
<select id="selectOrderCountByStatus" parameterType="String" resultType="int">
|
||
|
|
select count(*) from biz_maintenance_order where status = #{status} and order_type = '1'
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="selectOrderByPlateNumber" parameterType="String" resultMap="BizMaintenanceOrderResult">
|
||
|
|
<include refid="selectBizMaintenanceOrderVo"/>
|
||
|
|
where plate_number like concat('%', #{plateNumber}, '%') and order_type = '1'
|
||
|
|
order by create_time desc
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="selectOrderByTireCode" parameterType="String" resultMap="BizMaintenanceOrderResult">
|
||
|
|
select distinct o.order_id, o.order_no, o.vehicle_id, o.plate_number, o.type_code, o.factory_id, o.input_mileage, o.last_mileage, o.maintain_date, o.description, o.status, o.order_type, o.create_by, o.create_time, o.update_by, o.update_time, o.remark
|
||
|
|
from biz_maintenance_order o
|
||
|
|
inner join biz_order_tire_detail d on o.order_id = d.order_id
|
||
|
|
where d.tire_code like concat('%', #{tireCode}, '%') and o.order_type = '1'
|
||
|
|
order by o.create_time desc
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<update id="updateOrderStatus" parameterType="map">
|
||
|
|
update biz_maintenance_order
|
||
|
|
set status = #{status}, update_time = now()
|
||
|
|
where order_id = #{orderId}
|
||
|
|
</update>
|
||
|
|
</mapper>
|