<?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.cool.store.mapper.fees.WalletAllocationConfigMapper">
  <resultMap id="BaseResultMap" type="com.cool.store.entity.fees.WalletAllocationConfigDO">
    <!--
      WARNING - @mbg.generated
    -->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="join_brand" jdbcType="TINYINT" property="joinBrand" />
    <result column="invest_division_id" jdbcType="BIGINT" property="investDivisionId" />
    <result column="expense_type" jdbcType="VARCHAR" property="expenseType" />
    <result column="create_user_id" jdbcType="VARCHAR" property="createUserId" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  </resultMap>

  <select id="getAllWalletAllocation" resultType="com.cool.store.dto.fees.WalletAllocationDTO">
    select
        a.join_brand as joinBrand,
        a.expense_type as expenseType,
        b.payee_code as payeeCode,
        b.payee_name as payeeName
    from zxjp_fees_wallet_allocation_config a
        left join zxjp_fees_wallet_allocation_company b
        on a.id = b.config_id
    <where>
      <if test="joinBrand!=null">
        and join_brand = #{joinBrand}
      </if>
     <if test="expenseTypeList!=null and expenseTypeList.size>0">
       and expense_type in (
       <foreach collection="expenseTypeList" item="item" separator=",">
         #{item}
       </foreach>
       )
     </if>
    </where>

  </select>
</mapper>