<?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.cyksj.mapper.channel.ShopConfigMapper">
    <select id="getByChannelPopularizeId" resultType="com.cyksj.model.entity.ShopConfig">
        select sc.*
        from shop_config sc,
             channel c,
             channel_popularize cp
        where (sc.app_id = c.wx_shop_id or sc.app_id = c.zfb_shop_id)
          and c.id = cp.channel_id
          and cp.id = #{popularizeId,jdbcType=BIGINT}
          and sc.type = #{type,jdbcType=VARCHAR}
    </select>
    <select id="getByAppId" resultType="com.cyksj.model.entity.ShopConfig">
        select * from shop_config where app_id = #{appId}
    </select>
</mapper>