<?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.dbcapp.mapper.record.EnterpriseInfoMapper">
    <update id="updateByEpc" parameterType="com.nantian.cloud.dbcapp.entity.EnterpriseInfo">
        UPDATE enterprise_info a
        set  a.quotaShield=#{query.quotaShield}
        where a.enterpriseCode=#{query.enterpriseCode}
    </update>
    <select id="getShieldList" resultType="java.util.Map">
        select * from enterprise_info where enterpriseCode=#{enterpriseCode}
    </select>
    <select id="getPageList" resultType="com.nantian.cloud.dbcapp.entity.EnterpriseInfo">
        select * from enterprise_info where  1 = 1
        <if test="query.enterpriseCode != '' and query.enterpriseCode != null">
            and enterpriseCode like concat("%", #{query.enterpriseCode},"%")
        </if>
        <if test="query.cmpName != '' and query.cmpName != null">
            and cmpName like concat("%", #{query.cmpName},"%")
        </if>
        <if test="query.subordinateList != '' and query.subordinateList != null">
            and reportNum like concat("%", #{query.subordinateList},"%")
        </if>
        <if test="query.dataQualityCoding != '' and query.dataQualityCoding != null">
            and reportNum like concat("%", #{query.dataQualityCoding},"%")
        </if>
        <if test="query.accomplish != '' and query.accomplish != null">
            and reportNum like concat("%", #{query.accomplish},"%")
        </if>
        <if test="query.finishTime != '' and query.finishTime != null">
            and reportNum like concat("%", #{query.finishTime},"%")
        </if>
        <if test="query.applyDate != '' and query.applyDate != null">
            and applyDate like concat(#{query.applyDate},"%")
        </if>
        order by id desc
    </select>

    <select id="getInfoByName" resultType="com.nantian.cloud.dbcapp.entity.EnterpriseInfo">
        select * from enterprise_info where #{fileName} LIKE concat('%-',cmpName,'-%') limit 0,1
    </select>
</mapper>
