<?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.ezhizao.project.business.mapper.BizInspectionStandardsCheckMapper">

    <resultMap type="cn.ezhizao.project.business.domain.BizInspectionStandardsCheck" id="BizInspectionStandardsCheckResult">
        <id column="id" property="id"/>
    </resultMap>


    <select id="getList" parameterType="BizInspectionStandardsCheck" resultMap="BizInspectionStandardsCheckResult">
        SELECT * FROM biz_inspection_standards_check
        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
            deleted = 0
            <if test="instrument != null  and instrument != ''"> AND instrument = #{instrument}</if>
            <if test="productVersion != null  and productVersion != ''"> AND product_version = #{productVersion}</if>
            <if test="processCode != null  and processCode != ''"> AND process_code = #{processCode}</if>
            <if test="standard != null  and standard != ''"> AND standard = #{standard}</if>
            <if test="inspectionCode != null  and inspectionCode != ''"> AND inspection_code = #{inspectionCode}</if>
            <if test="inspectionName != null  and inspectionName != ''"> AND inspection_name like concat('%', #{inspectionName}, '%')</if>
        </trim>
    </select>

    <delete id="physicalDelete">
        DELETE FROM biz_inspection_standards_check
        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
            <if test="id != null">
                id = #{id} AND
            </if>
       <!-- 删除条件为其他外键可以在这里加 -->
        </trim>
    </delete>
</mapper>
