|  |  |  | 
|---|
|  |  |  | <if test="record.level!=null and record.level!=''"> | 
|---|
|  |  |  | and m.level=#{record.level} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="record.isSale!=null and record.isSale!=''"> | 
|---|
|  |  |  | and m.is_sale=#{record.isSale} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | </where> | 
|---|
|  |  |  | GROUP BY m.id order by m.CREATED_TIME desc | 
|---|
|  |  |  | 
|---|
|  |  |  | where a.open_id = #{openId} limit 1 | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <select id="getsalemanRuleList" resultType="cc.mrbird.febs.mall.entity.MallMember"> | 
|---|
|  |  |  | SELECT m.*, | 
|---|
|  |  |  | b.name couponName | 
|---|
|  |  |  | FROM mall_member m | 
|---|
|  |  |  | LEFT Join saleman_coupon a on m.id = a.member_id | 
|---|
|  |  |  | LEFT Join mall_goods_coupon b on b.id = a.coupon_id and b.state = 2 | 
|---|
|  |  |  | <where> | 
|---|
|  |  |  | <if test="record != null" > | 
|---|
|  |  |  | <if test="record.name!=null and record.name!=''"> | 
|---|
|  |  |  | and m.name like concat('%',  #{record.name},'%') | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="record.account!=null and record.account!=''"> | 
|---|
|  |  |  | and m.phone like concat('%',  #{record.account},'%') | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="record.isSale!=null and record.isSale!=''"> | 
|---|
|  |  |  | and m.is_sale=#{record.isSale} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | </where> | 
|---|
|  |  |  | order by m.CREATED_TIME desc | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </mapper> | 
|---|