<?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.muchinfo.mtp3interface.mapper.IQuotesourcegroupMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.muchinfo.mtp3pojos.entity.Quotesourcegroup">
        <id column="AUTOID" property="autoid" />
        <result column="GROUPCODE" property="groupcode" />
        <result column="GROUPNAME" property="groupname" />
        <result column="SUMMERTIMEGROUPID" property="summertimegroupid" />
        <result column="REMARK" property="remark" />
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        AUTOID, GROUPCODE, GROUPNAME, SUMMERTIMEGROUPID, REMARK
    </sql>

    <select id="quoteSourceGroup" resultType="com.muchinfo.mtp3pojos.entity.Quotesourcegroup">
        select q.groupCode,q.groupName,q.autoId,q.summerTimeGroupId,s.groupName as summerGroupName
        from QuoteSourceGroup q
        left join SummerTimeGroup s on s.autoid=q.summertimegroupid
        order by q.autoId
    </select>
    <select id="quoteSourceGroupRunStep" resultType="com.muchinfo.mtp3pojos.vo.tradingmarket.TradingGroupSetResult">
        SELECT q.groupName,q.autoId,
               wm_concat(DISTINCT qr.TRADEWEEKDAY)WEEKPLAN
        FROM quotesourcegroup q
                 left join quotesourcegrouprunstep qr on q.autoid= qr.groupid
        GROUP BY q.autoid, q.groupname
        ORDER BY q.autoid,q.groupname asc
    </select>


</mapper>
