<?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.willalp.yiqing.mapper.HsOrdersLogDataMapper">
    <resultMap type="com.willalp.yiqing.domain.HsOrdersLogData" id="HsOrdersLogDataResult">
        <result property="dataId" column="data_id"/>
        <result property="logId" column="log_id"/>
        <result property="userNo" column="user_no"/>
        <result property="userName" column="user_name"/>
        <result property="otherAttest" column="other_attest"/>
        <result property="attestNo" column="attest_no"/>
        <result property="phone" column="phone"/>
        <result property="address" column="address"/>
        <result property="houseNo" column="house_no"/>
        <result property="areaName" column="area_name"/>
        <result property="belongName" column="belong_name"/>
        <result property="belongPhone" column="belong_phone"/>
        <result property="sevenSendOrders" column="seven_send_orders"/>
        <result property="samplingTime" column="sampling_time"/>
        <result property="sort" column="sort"/>
        <result property="resultTime" column="result_time"/>
        <result property="rnaResult" column="rna_result"/>
        <result property="ctValue" column="ct_value"/>
        <result property="antigenResult" column="antigen_result"/>
        <result property="excelT1" column="excel_t1"/>
        <result property="excelT2" column="excel_t2"/>
    </resultMap>

    <sql id="selectHsOrdersLogDataVo">
        select data_id,
               log_id,
               user_no,
               user_name,
               other_attest,
               attest_no,
               phone,
               address,
               house_no,
               area_name,
               belong_name,
               belong_phone,
               seven_send_orders,
               sampling_time,
               sort,
               result_time,
               rna_result,
               ct_value,
               antigen_result,
               excel_t1,
               excel_t2
        from hs_yiqing_orders_log_data
    </sql>

    <select id="selectHsOrdersLogDataList" parameterType="HsOrdersLogData" resultMap="HsOrdersLogDataResult">
        <include refid="selectHsOrdersLogDataVo"/>
        <where>
            is_delete = 0
            <if test="userNo != null  and userNo != ''">
                and user_no = #{userNo}
            </if>
            <if test="userName != null  and userName != ''">
                and user_name like concat('%', #{userName}, '%')
            </if>
            <if test="otherAttest != null  and otherAttest != ''">
                and other_attest = #{otherAttest}
            </if>
            <if test="attestNo != null  and attestNo != ''">
                and attest_no = #{attestNo}
            </if>
            <if test="phone != null  and phone != ''">
                and phone = #{phone}
            </if>
            <if test="address != null  and address != ''">
                and address = #{address}
            </if>
            <if test="houseNo != null  and houseNo != ''">
                and house_no = #{houseNo}
            </if>
            <if test="areaName != null  and areaName != ''">
                and area_name like concat('%', #{areaName}, '%')
            </if>
            <if test="belongName != null  and belongName != ''">
                and belong_name like concat('%', #{belongName}, '%')
            </if>
            <if test="belongPhone != null  and belongPhone != ''">
                and belong_phone = #{belongPhone}
            </if>
            <if test="sevenSendOrders != null  and sevenSendOrders != ''">
                and seven_send_orders = #{sevenSendOrders}
            </if>
            <if test="samplingTime != null ">
                and sampling_time = #{samplingTime}
            </if>
            <if test="sort != null  and sort != ''">
                and sort = #{sort}
            </if>
            <if test="resultTime != null ">
                and result_time = #{resultTime}
            </if>
            <if test="rnaResult != null  and rnaResult != ''">
                and rna_result = #{rnaResult}
            </if>
            <if test="ctValue != null  and ctValue != ''">
                and ct_value = #{ctValue}
            </if>
            <if test="antigenResult != null  and antigenResult != ''">
                and antigen_result = #{antigenResult}
            </if>
            <if test="excelT1 != null  and excelT1 != ''">
                and excel_t1 = #{excelT1}
            </if>
            <if test="excelT2 != null  and excelT2 != ''">
                and excel_t2 = #{excelT2}
            </if>
        </where>
    </select>
</mapper>
