SampleResultTrackingMapper.xml 2.24 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.SampleResultTrackingMapper">

    <resultMap id="SampleResultTracking" type="com.lframework.xingyun.sc.entity.SampleResultTracking">
        <id column="id" property="id"/>
        <result column="customer_id" property="customerId"/>
        <result column="workshop_id" property="workshopId"/>
        <result column="order_id" property="orderId"/>
        <result column="surface" property="surface"/>
        <result column="performance" property="performance"/>
        <result column="tolerance" property="tolerance"/>
        <result column="banding_pattern" property="bandingPattern"/>
        <result column="packaging" property="packaging"/>
        <result column="weight" property="weight"/>
        <result column="other" property="other"/>
        <result column="create_by_id" property="createById"/>
        <result column="update_by_id" property="updateById"/>
        <result column="create_time" property="createTime"/>
        <result column="update_time" property="updateTime"/>
    </resultMap>

    <sql id="SampleResultTracking_sql">
        SELECT
            tb.id,
            tb.customer_id,
            tb.workshop_id,
            tb.order_id,
            tb.surface,
            tb.performance,
            tb.tolerance,
            tb.banding_pattern,
            tb.packaging,
            tb.weight,
            tb.other,
            tb.create_by_id,
            tb.update_by_id,
            tb.create_time,
            tb.update_time
        FROM sample_result_tracking AS tb
    </sql>

    <select id="query" resultMap="SampleResultTracking">
        <include refid="SampleResultTracking_sql"/>
        <where>
            <if test="vo.customerId != null and vo.customerId != ''">
             AND tb.customer_id = #{vo.customerId}
            </if>
            <if test="vo.workshopId != null and vo.workshopId != ''">
             AND tb.workshop_id = #{vo.workshopId}
            </if>
            <if test="vo.orderId != null and vo.orderId != ''">
             AND tb.order_id = #{vo.orderId}
            </if>
        </where>
    </select>
</mapper>