<?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.dayou.mapper.BusinessPerformanceDistributionMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.dayou.entity.BusinessPerformanceDistribution">
        <result column="id" property="id" />
        <result column="created" property="created" />
        <result column="deleted" property="deleted" />
        <result column="modified" property="modified" />
        <result column="business_id" property="businessId" />
        <result column="business_type" property="businessType" />
        <result column="report_no" property="reportNo" />
        <result column="performance_distribution" property="performanceDistribution" />
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id,
        created,
        deleted,
        modified,
        business_id, business_type, report_no, performance_distribution
    </sql>

    <!--根据申报id获取绩效比列分配集合-->
    <select id="alloAssetsDistributionDeclareId" resultType="com.dayou.dto.UserShareRate">
        SELECT member_id AS userId, member_type AS memberType, performance_distribution AS rate, name, participation_duration AS participationDuration
        FROM business_performance_distribution, user
        WHERE declare_id = #{declareId}
        AND member_id = user.id
        AND business_performance_distribution.deleted = 0
    </select>

</mapper>
