<?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.nantian.cloud.jljc.mapper.AdvancedMaterialMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.nantian.cloud.jljc.entity.AdvancedMaterial">
        <id column="id" property="id" />
        <result column="tech_name" property="techName" />
        <result column="industry_code" property="industryCode" />
        <result column="industry_name" property="industryName" />
        <result column="file" property="file" />
        <result column="file_size" property="fileSize" />
        <result column="userid" property="userid"/>
        <result column="update_time" property="updateTime"/>
        <result column="del_flag" property="delFlag"/>
        <result column="dept_id" property="deptId"/>
    </resultMap>

    <sql id="Base_Column_List">
        id, tech_name, industry_code, industry_name, file, file_size, userid, update_time, del_flag, dept_id
    </sql>

    <select id="getPageScope" resultType="com.nantian.cloud.jljc.entity.AdvancedMaterial">
        select <include refid="Base_Column_List"></include>
        from advanced_material
        <trim prefix="where" prefixOverrides="and">
            <if test="query.techName != null and query.techName != ''">
                and tech_name like concat("%",#{query.techName},"%")
            </if>
            <if test="query.industryCode != null and query.industryCode != ''">
                and industry_code =  #{query.industryCode}
            </if>
            <if test="query.industryName != null and query.industryName != ''">
                and industry_name =  #{query.industryName}
            </if>
            <if test="query.delFlag != null and query.delFlag != ''">
                and del_flag = #{query.delFlag}
            </if>
        </trim>
        order by file desc
    </select>


</mapper>
