RequestCarTicketMapper.xml 3.4 KB
<?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.lframework.xingyun.sc.mappers.RequestCarTicketMapper">

    <resultMap id="RequestCarTicket" type="com.lframework.xingyun.sc.entity.RequestCarTicket">
        <id column="id" property="id"/>
        <result column="request_car_data" property="requestCarData"/>
        <result column="dept_id" property="deptId"/>
        <result column="delivery_date" property="deliveryDate"/>
        <result column="workshop_id" property="workshopId"/>
        <result column="order_no" property="orderNo"/>
        <result column="customer_short_name" property="customerShortName"/>
        <result column="destination" property="destination"/>
        <result column="quantity" property="quantity"/>
        <result column="consignee" property="consignee"/>
        <result column="phone" property="phone"/>
        <result column="return_plan_arrangement" property="returnPlanArrangement"/>
        <result column="other" property="other"/>
        <result column="external_auditor" property="externalAuditor"/>
        <result column="loading_time" property="loadingTime"/>
        <result column="special_loading_requirement" property="specialLoadingRequirement"/>
        <result column="business_office_auditor" property="businessOfficeAuditor"/>
        <result column="operations_department_auditor" property="operationsDepartmentAuditor"/>
        <result column="create_by_id" property="createById"/>
        <result column="create_by" property="createBy"/>
        <result column="update_by_id" property="updateById"/>
        <result column="update_by" property="updateBy"/>
        <result column="create_time" property="createTime"/>
        <result column="update_time" property="updateTime"/>
    </resultMap>

    <sql id="RequestCarTicket_sql">
        SELECT
            tb.id,
            tb.request_car_data,
            tb.dept_id,
            tb.delivery_date,
            tb.workshop_id,
            tb.order_no,
            tb.customer_short_name,
            tb.destination,
            tb.quantity,
            tb.consignee,
            tb.phone,
            tb.return_plan_arrangement,
            tb.other,
            tb.external_auditor,
            tb.loading_time,
            tb.special_loading_requirement,
            tb.business_office_auditor,
            tb.operations_department_auditor,
            tb.create_by_id,
            tb.create_by,
            tb.update_by_id,
            tb.update_by,
            tb.create_time,
            tb.update_time
        FROM request_car_ticket AS tb
    </sql>

    <select id="query" resultMap="RequestCarTicket">
        <include refid="RequestCarTicket_sql"/>
        <where>
            <if test="vo.requestCarData != null">
                AND tb.request_car_data = #{vo.requestCarData}
            </if>
            <if test="vo.workshopId != null and vo.workshopId != ''">
                AND tb.workshop_id = #{vo.workshopId}
            </if>
            <if test="vo.orderNo != null and vo.orderNo != ''">
                AND tb.order_no = #{vo.orderNo}
            </if>
            <if test="vo.customerShortName != null and vo.customerShortName != ''">
                AND tb.customer_short_name LIKE CONCAT('%', #{vo.customerShortName})
            </if>
        </where>
        ORDER BY tb.update_time DESC
    </select>
</mapper>