<?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.cslg.report.mapper.InvalidRecordMapper">
<delete id="deleteInvalidRecord">
    delete from INVALID_RECORD where ID=#{id}
</delete>

<update id="updateInvalidRecord">
update INVALID_RECORD set
PATENT_NO=#{patentNo},PERSON=#{person},PERSON_ID=#{personId},INVALID_TIME={invalidTime},JUDGMENT_TIME=#{judgmentTime},`RESULT`=#{resultS},FILE_ID=#{fileId},REPORT_ID=#{reportId}
where ID=#{id}
</update>

<insert id="addInvalidRecord" >
insert into INVALID_RECORD (PATENT_NO,PERSON,PERSON_ID,INVALID_TIME,JUDGMENT_TIME,`RESULT`,FILE_ID,REPORT_ID)
values(#{patentNo},#{person},#{personId},#{invalidTime},#{judgmentTime},#{resultS},#{fileId},#{reportId})
</insert>
<select id="select" resultType="cn.cslg.report.entity.InvalidRecord">
<bind name="n" value="(pageNO-1)pageSize"/>
select * from INVALID_RECORD
<where>
    <if test="patentNo !='' and patentNo !=null">
        PATENT_NO like concat('%', #{patentNo}, '%')
    </if>
    <if test="person !='' and person !=null">
        and PERSON like concat('%', #{person}, '%')
    </if>
    <if test="personId !='' and personId !=null">
        and PERSON_ID like concat('%', #{personId}, '%')
    </if>
    <if test="invalidTime !='' and invalidTime !=null">
        and INVALID_TIME like concat('%', #{invalidTime}, '%')
    </if>
    <if test="judgmentTime !='' and judgmentTime !=null">
        and `JUDGMENT_TIME` like concat('%', #{judgmentTime}, '%')
    </if>
    <if test="resultS !='' and resultS !=null">
        and `RESULT` like concat('%', #{resultS}, '%')
    </if>
    <if test="caseDetails !='' and caseDetails !=null">
        and CASE_DETAILS like concat('%', #{caseDetails}, '%')
    </if>
    <if test="fileId !='' and fileId !=null">
        and FILE_ID like concat('%', #{fileId}, '%')
    </if>
</where>
</select>
</mapper>