<?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.ssm.manage.mapper.SmsBalanceMapper">

    <resultMap type="com.ssm.manage.entity.SmsBalance" id="baseMap">
        <result property="id" column="id" jdbcType="BIGINT"/>
        <result property="storeId" column="store_id" jdbcType="BIGINT"/>
        <result property="smsAccount" column="sms_account" jdbcType="VARCHAR"/>
        <result property="smsPassword" column="sms_password" jdbcType="VARCHAR"/>
        <result property="smsUrl" column="sms_url" jdbcType="VARCHAR"/>
        <result property="smsType" column="sms_type" jdbcType="INTEGER"/>
        <result property="parentId" column="parent_id" jdbcType="BIGINT"/>
        <result property="smsStoreBalance" column="sms_store_balance" jdbcType="INTEGER"/>
        <result property="smsAccountBalance" column="sms_account_balance" jdbcType="INTEGER"/>
    </resultMap>
    <select id="selectGroupByAccount" resultMap="baseMap">
        select * from sms_balance group by sms_account
    </select>
    <select id="selectBySmsBalance" resultMap="baseMap">
        select * from sms_balance where 1=1
                                    <if test="smsAccount!=null">and sms_account = #{smsAccount}</if>
    </select>


</mapper>

