<?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.ltgk.crew.mapper.DsCrewCredentialMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ltgk.crew.domain.entity.DsCrewCredential">
        <result property="id" column="id"/>
        <result property="waterCode" column="water_code"/>
        <result property="crewId" column="crew_id"/>
        <result property="crewName" column="crew_name"/>
        <result property="idCardNo" column="id_card_no"/>
        <result property="phone" column="phone"/>
        <result property="certificateType" column="certificate_type"/>
        <result property="certificateTypeName" column="certificate_type_name"/>
        <result property="categoryCode" column="category_code"/>
        <result property="categoryName" column="category_name"/>
        <result property="certificateKindCode" column="certificate_kind_code"/>
        <result property="certificateKindName" column="certificate_kind_name"/>
        <result property="certificateLevel" column="certificate_level"/>
        <result property="certificateLevelName" column="certificate_level_name"/>
        <result property="certificatePost" column="certificate_post"/>
        <result property="certificatePostName" column="certificate_post_name"/>
        <result property="applyBoat" column="apply_boat"/>
        <result property="certificateCode" column="certificate_code"/>
        <result property="certificatePic" column="certificate_pic"/>
        <result property="certificateAuthority" column="certificate_authority"/>
        <result property="certificateAuthorityName" column="certificate_authority_name"/>
        <result property="certificatePeople" column="certificate_people"/>
        <result property="certificateIssuedDate" column="certificate_issued_date"/>
        <result property="certificateAwardedDate" column="certificate_awarded_date"/>
        <result property="certificateExpiredDate" column="certificate_expired_date"/>
        <result property="certificateStatus" column="certificate_status"/>
        <result property="archivesCode" column="archives_code"/>
        <result property="manyPositionsFlag" column="many_positions_flag"/>
        <result property="timestamp" column="timestamp"/>
        <result property="operateTime" column="operate_time"/>
        <result property="file" column="file"/>
        <result property="fileName" column="file_name"/>
        <result property="areaCode" column="area_code"/>
        <result property="areaName" column="area_name"/>
        <result property="createBy" column="create_by"/>
        <result property="createAt" column="create_at"/>
        <result property="updateBy" column="update_by"/>
        <result property="updateAt" column="update_at"/>
        <result property="delFlag" column="del_flag"/>
        <result property="remark" column="remark"/>
    </resultMap>

    <select id="selectOverDue" resultType="java.lang.Integer">
        select count(1)
        from ds_boat_crew dbc
        where dbc.del_flag = 0
          and dbc.certificate_expired_date &lt; CURDATE()
    </select>
    <select id="selectOverDueNew" resultType="java.lang.Integer">
        select count(1)
        from ds_crew_credential dbc
        where dbc.del_flag = 0
          and dbc.certificate_expired_date &lt; CURDATE()
    </select>
</mapper>
