SellerWalletMapper.xml 2 KB
<?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.yoho.order.dal.SellerWalletMapper">
    <resultMap id="BaseResultMap" type="com.yoho.order.model.SellerWallet" >
        <id column="id" property="id" jdbcType="INTEGER" />
        <result column="uid" property="uid" jdbcType="INTEGER" />
        <result column="amount" property="amount" jdbcType="DECIMAL" />
        <result column="lock_amount" property="lockAmount" jdbcType="DECIMAL" />
        <result column="status" property="status" jdbcType="TINYINT" />
        <result column="type" property="type" jdbcType="TINYINT" />
        <result column="create_time" property="createTime" jdbcType="INTEGER" />
        <result column="update_time" property="updateTime" jdbcType="INTEGER" />
    </resultMap>
    <sql id="Base_Column_List" >
        id, uid, amount,lock_amount,status, type, create_time, update_time
    </sql>
    <select id="selectTotalByUidAndMerchantUids" resultType="java.lang.Integer">
        select count(1) from seller_wallet
        <where>
            <if test="uid != null and uid != ''">uid=#{uid}</if>
            <if test="merchantUids != null">
               and uid in
                <foreach collection="merchantUids" item="muid" open="(" separator="," close=")">
                    #{muid}
                </foreach>
            </if>
        </where>
    </select>
    <select id="selectByUidAndMerchantUids" resultType="com.yoho.order.model.SellerWallet">
        select <include refid="Base_Column_List" /> from seller_wallet
        <where>
            <if test="uid != null and uid != ''">uid=#{uid}</if>
            <if test="merchantUids != null">
              and  uid in
                <foreach collection="merchantUids" item="muid" open="(" separator="," close=")">
                    #{muid}
                </foreach>
            </if>
        </where>
        order by id desc limit #{start},#{size}
    </select>
</mapper>