<?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.srs.diagnostic.mapper.DiaReportSubmissionsMapper">

    <resultMap type="DiaReportSubmissions" id="DiaReportSubmissionsResult">
        <result property="relId"    column="relId"    />
        <result property="reportId"    column="reportId"    />
        <result property="moduleName"    column="moduleName"    />
        <result property="reportName"    column="reportName"    />
        <result property="status"    column="status"    />
        <result property="term_id"    column="term_id"    />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
    </resultMap>

    <sql id="selectDiaReportSubmissionsVo">
        select relId, reportId, moduleName, reportName, status, term_id, create_by, create_time from dia_report_release  where status=0
    </sql>

    <select id="selectDiaReportSubmissionsList" parameterType="DiaReportSubmissions" resultMap="DiaReportSubmissionsResult">
        <include refid="selectDiaReportSubmissionsVo"/>
        <where>
            <if test="moduleName != null  and moduleName != ''"> and moduleName like concat('%', #{moduleName}, '%')</if>
            <if test="reportName != null  and reportName != ''"> and reportName like concat('%', #{reportName}, '%')</if>
            <if test="term_id != 0"> and term_id = #{term_id}</if>
            <if test="status != null  and status != ''"> and status = #{status}</if>
        </where>
    </select>




</mapper>
