<?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.RepayMapper">
    <resultMap id="RepayVOResultMap" type="com.usoft.fin.grpc.dal.entity.vo.RepayVO" extends="BaseResultMap">
        <result column="product_name" property="productName" jdbcType="VARCHAR"/>
    </resultMap>

    <select id="findByDrawCode" parameterType="string" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from t_repay where draw_code = #{drawApplyCode,jdbcType=VARCHAR}
    </select>
    <select id="countByEnuu" parameterType="int" resultType="int">
    select count(1) from t_repay where enuu = #{enuu,jdbcType=INTEGER}
  </select>
    <select id="selectListByEnuu" resultMap="RepayVOResultMap">
        select
        <include refid="Table_Base_Column_List"/>, t_product.name as product_name
        from t_repay , t_product where t_repay.product_code = t_product.code
        and t_repay.enuu = #{enuu} limit #{start}, #{pageSize}
    </select>
    <select id="findByCode" parameterType="string" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from t_repay where code = #{code}
    </select>
</mapper>