<?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.consult.mapper.BizDayworkItemConsultMapper">

    <resultMap type="cn.ezhizao.project.business.consult.domain.BizDayworkItemConsult" id="BizDayworkItemConsultResult">
        <id column="id" property="id"/>
    </resultMap>


    <select id="getList" parameterType="BizDayworkItemConsult" resultMap="BizDayworkItemConsultResult">
        SELECT * FROM biz_daywork_item_consult
        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
            deleted = 0
            <if test="nickName != null  and nickName != ''"> AND nick_name like concat('%', #{nickName}, '%')</if>
            <if test="lotCode != null  and lotCode != ''"> AND lot_code = #{lotCode}</if>
            <if test="productDescription != null  and productDescription != ''"> AND product_description = #{productDescription}</if>
            <if test="consultDepartment != null "> AND consult_department = #{consultDepartment}</if>
            <if test="processAlias != null  and processAlias != ''"> AND process_alias = #{processAlias}</if>
            <if test="content != null  and content != ''"> AND content = #{content}</if>
            <if test="isOutsourcedInspection != null "> AND is_outsourced_inspection = #{isOutsourcedInspection}</if>
            <if test="consultResultResult != null  and consultResultResult != ''"> AND consult_result_result = #{consultResultResult}</if>
            <if test="isProcessInspection != null "> AND is_process_inspection = #{isProcessInspection}</if>
            <if test="status != null "> AND status = #{status}</if>
        </trim>
    </select>

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