<?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="cn.roadm.mapper.CityGroupMapper">
    <select id="listPageCityGroups" resultType="cn.roadm.bo.CityGroupBO">
        select id, id as group_id, name, DATE_FORMAT(createtime, '%Y-%m-%d %H:%i:%s') as createtime, `status`, `desc`
        from sms_city_group
        <where>
            status = 1
            <if test="name != null and name != ''">
                and name like CONCAT('%', #{name}, '%')
            </if>
        </where>
    </select>

    <select id="getCityGroupConfig" resultType="cn.roadm.bo.CityGroupBO">
        select id, group_id, mobilechannel, unicomchannel, telecomchannel, city
        from sms_city_group_config
        where group_id = #{group_id}
    </select>

    <select id="queryChannelInfo" resultType="cn.roadm.bo.PaInfo">
    </select>

    <update id="updatePaBaseInfo" parameterType="PaConfig">
        update sms_send_channel_info set business_manager = #{businessManager}, cooperate_company = #{cooperateCompany}, province=#{province},
         provinceNetPrice=#{provinceNetPrice}, autoExtend=#{autoExtend}, `desc`=#{desc},
         supplier_id=#{supplier_id},pro_group_price_id=#{pro_group_price_id},access_province=#{access_province},access_city=#{access_city},
         inter_price_group=#{interPriceGroup},
        access_company=#{access_company}, sign_port=#{sign_port}, use_extend_type=#{useExtendType}, attract_limit=#{attractLimit}, link_properties=#{linkProperties}, sign_template_limit=#{signTemplateLimit}, sign_channel_enable=#{signChannelEnable}, auto_test_phone=#{autoTestPhone} where id = #{id}
    </update>

    <update id="updateCmppPrice">
        update sms_carrier_channel_info set price = #{price} where id = #{id}
    </update>
</mapper>
