| <?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="cc.mrbird.febs.mall.mapper.MallScoreRecordMapper"> | 
|   | 
|     <select id="selectSumScoreCnt" resultType="java.math.BigDecimal"> | 
|         select IFNULL(sum(IFNULL(score_cnt,0)),0) from mall_score_record | 
|     </select> | 
|   | 
|     <select id="selectList" resultType="cc.mrbird.febs.mall.entity.MallScoreRecord"> | 
|         select * from mall_score_record where surplus_cnt > 0 | 
|     </select> | 
|   | 
|     <select id="gerRoleReleaseListInPage" resultType="cc.mrbird.febs.mall.entity.MallScoreRecord"> | 
|         select | 
|                a.*, | 
|                b.name name, | 
|                b.phone phone, | 
|                b.invite_id inviteId | 
|         from mall_score_record a | 
|         left join mall_member b on a.member_id = b.id | 
|         <where> | 
|             <if test="record != null"> | 
|                 <if test="record.name != null and record.name != ''"> | 
|                     and b.name like CONCAT('%', CONCAT(#{record.name}, '%')) | 
|                 </if> | 
|                 <if test="record.account != null and record.account != ''"> | 
|                     and (b.phone like CONCAT('%', CONCAT(#{record.account}, '%')) | 
|                         or b.invite_id like CONCAT('%', CONCAT(#{record.account}, '%'))) | 
|                 </if> | 
|             </if> | 
|         </where> | 
|         order by a.created_time desc | 
|     </select> | 
|   | 
|     <select id="gerRoleReleaseChildInPage" resultType="cc.mrbird.febs.mall.entity.MallMoneyFlow"> | 
|         select | 
|                a.* | 
|         from mall_money_flow a | 
|         where | 
|             a.order_no = #{record.scoreNo} | 
|         order by a.created_time desc | 
|     </select> | 
|   | 
|     <select id="selectSurplusCntByMemberId" resultType="java.math.BigDecimal"> | 
|         select | 
|                IFNULL(sum(IFNULL(surplus_cnt,0)),0) | 
|         from mall_score_record | 
|         where member_id = #{memberId} | 
|     </select> | 
|   | 
| </mapper> |