parent
4136a2ac88
commit
70df18c2d0
@ -1,7 +1,47 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.apache.ibatis.annotations.Select; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* mapper扩展类 |
||||
*/ |
||||
public interface BsAgentPriceMapperExt { |
||||
} |
||||
|
||||
@Select("<script>" + |
||||
" select * from (select " + |
||||
" c.agent_name agentName," + |
||||
" c.agent_staff_name agentStaffName," + |
||||
" b.province_name provinceName," + |
||||
" b.source_type sourceType, " + |
||||
" b.mer_no merNo," + |
||||
" b.mer_name merName," + |
||||
" a.oil_no oilNo," + |
||||
" a.price_official priceOfficial," + |
||||
" a.price_gun priceGun," + |
||||
" a.price_vip priceVip," + |
||||
" ROUND(a.price_vip * (d.price_rate / 100),2) terminalPrice," + |
||||
" d.price_rate priceRate," + |
||||
" d.service_fee_rate serviceFeeRate" + |
||||
" from bs_gas_oil_price a" + |
||||
" LEFT JOIN bs_merchant b on b.id = a.mer_id" + |
||||
" LEFT JOIN bs_agent_mer c on c.mer_no = b.mer_no and c.`status` = 1" + |
||||
" LEFT JOIN bs_agent_price d on d.agent_mer_id = c.id" + |
||||
" where a.`status` = 1 and c.`status` = 1 and c.agent_staff_id is not null and d.`status` = 1" + |
||||
" <if test='param.agentId != null'> and c.agent_id = #{param.agentId} </if>" + |
||||
" <if test='param.agentStaffId != null'> and c.agent_staff_id = #{param.agentStaffId} </if>" + |
||||
" <if test='param.provinceCode != null'> and b.province_code = #{param.provinceCode} </if>" + |
||||
" <if test='param.merNo != null'> and b.mer_no like concat('%',#{param.merNo},'%') </if>" + |
||||
" <if test='param.merName != null'> and b.mer_name like concat('%',#{param.merName},'%') </if>" + |
||||
" <if test='param.sourceType != null'> and b.source_type = #{param.sourceType} </if>" + |
||||
" <if test='param.oilNo != null'> and a.oil_no = #{param.oilNo} </if>" + |
||||
" ORDER BY c.agent_staff_id,b.mer_no) a " + |
||||
" GROUP BY a.merNo,a.oilNo,a.merNo" + |
||||
" ORDER BY a.merNo,a.merNo" + |
||||
"</script>") |
||||
List<Map<String,Object>> queryAgentPriceList(@Param("param") Map<String,Object> param); |
||||
|
||||
} |
||||
|
Loading…
Reference in new issue