<?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.usoft.fin.grpc.dal.mapper.DrawApplyMapper">


    <select id="findByCode" parameterType="java.lang.String" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from t_draw_apply
        where code = #{code}
    </select>

    <select id="findByCreditCodeAndAuditStatus" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from t_draw_apply
        where credit_code = #{creditCode} and audit_status = #{auditStatus}
    </select>

    <select id="findListByEnuu" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from t_draw_apply where enuu = #{enuu} limit #{start}, #{pageSize}
    </select>

    <select id="findByEnuuAndProductCode" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from t_draw_apply where enuu = #{enuu} and product_code = #{productCode}
    </select>


    <select id="countByEnuu" parameterType="int" resultType="int">
      select count(1) from t_draw_apply where enuu = #{enuu,jdbcType=INTEGER}
    </select>
</mapper>
