<?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.yifu.cloud.plus.v1.check.mapper.TCheckLockMapper">
    <resultMap id="tCheckIdCardMap" type="com.yifu.cloud.plus.v1.check.entity.TCheckLock">
        <id property="id" column="id"/>
        <result property="createUser" column="CREATE_USER"/>
        <result property="createUserName" column="CREATE_USER_NAME"/>
        <result property="createTime" column="CREATE_TIME"/>
        <result property="createMonth" column="CREATE_MONTH"/>
        <result property="importNum" column="IMPORT_NUM"/>
        <result property="apiNum" column="API_NUM"/>
        <result property="deleteFlag" column="DELETE_FLAG"/>
    </resultMap>
    <sql id="Base_Column_List">
        ID,
        CREATE_USER,
        CREATE_USER_NAME,
        CREATE_TIME,
        CREATE_MONTH,
        IMPORT_NUM,
        API_NUM,
        DELETE_FLAG
    </sql>

    <!--获取所有数据-->
    <select id="getAllList" resultMap="tCheckIdCardMap">
        SELECT
            <include refid="Base_Column_List"/>
        FROM t_check_lock a
        where a.DELETE_FLAG = 0
    </select>

	<!--获取所有数据-->
	<select id="getApiNumByMonth" resultType="java.lang.Integer">
		select ifnull(sum(c.API_NUM),0) apiNum from t_check_lock c where c.CREATE_MONTH = #{nowMonth}
	</select>

</mapper>
