<?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="cn.cecep.talroad.mapper.SIntegratedRoutineInspectionMapper">

    <resultMap type="cn.cecep.talroad.domain.SIntegratedRoutineInspection" id="SIntegratedRoutineInspectionResult">
        <result property="id"    column="id"    />
        <result property="factoryId"    column="factory_id"    />
        <result property="particularYear"    column="particular_year"    />
        <result property="checkRounds"    column="check_rounds"    />
        <result property="checkTime"    column="check_time"    />
        <result property="inspector"    column="inspector"    />
        <result property="checkScore"    column="check_score"    />
        <result property="totalPoints"    column="total_points"    />
        <result property="reviewTypes"    column="review_types"    />
        <result property="reviewStatus"    column="review_status"    />
    </resultMap>


    <sql id="selectSIntegratedRoutineInspectionVo">
        select id, factory_id, particular_year, check_rounds, check_time, inspector, check_score, total_points, review_types, review_status from s_integrated_routine_inspection
    </sql>

    <select id="selectSIntegratedRoutineInspectionList" parameterType="cn.cecep.talroad.domain.SIntegratedRoutineInspection" resultMap="SIntegratedRoutineInspectionResult">
        <include refid="selectSIntegratedRoutineInspectionVo"/>
        <where>
            <if test="factoryId != null  and factoryId != ''"> and factory_id = #{factoryId}</if>
            <if test="particularYear != null  and particularYear != ''"> and particular_year = #{particularYear}</if>
            <if test="checkRounds != null  and checkRounds != ''"> and check_rounds = #{checkRounds}</if>
            <if test="checkTime != null  and checkTime != ''"> and check_time = #{checkTime}</if>
            <if test="inspector != null  and inspector != ''"> and inspector = #{inspector}</if>
            <if test="checkScore != null  and checkScore != ''"> and check_score = #{checkScore}</if>
            <if test="totalPoints != null  and totalPoints != ''"> and total_points = #{totalPoints}</if>
            <if test="reviewTypes != null  and reviewTypes != ''"> and review_types = #{reviewTypes}</if>
            <if test="reviewStatus != null  and reviewStatus != ''"> and review_status = #{reviewStatus}</if>
        </where>
    </select>

</mapper>
