@ -79,6 +79,52 @@ public interface BsAgentMerMapperExt {
" <if test='param.isAgentAllot != null and param.isAgentAllot == false'> and a.agentId is null </if>"+
" GROUP BY a.merId "+
" </script> "})
/*@Select("<script>"+
" SELECT"+
" a.agentMerId,"+
" a.merSourceType,"+
" a.provinceCode,"+
" a.provinceName,"+
" a.merNo,"+
" a.merName,"+
" a.merAddress,"+
" a.agentName,"+
" a.`status`,"+
" a.createTime"+
" FROM"+
" ("+
" SELECT"+
" a.id merId,"+
" a.source_type merSourceType,"+
" a.province_code provinceCode,"+
" a.province_name provinceName,"+
" a.mer_no merNo,"+
" a.mer_name merName,"+
" a.address merAddress,"+
" a.`status`,"+
" b.id agentMerId,"+
" b.agent_id agentId,"+
" b.agent_name agentName,"+
" b.agent_staff_id agentStaffId,"+
" b.agent_staff_name agentStaffName,"+
" b.create_time createTime "+
" FROM"+
" bs_merchant a"+
" LEFT JOIN (select id,mer_id,agent_id,agent_name,agent_staff_id,agent_staff_name,create_time from bs_agent_mer "+
" where agent_id = #{param.agentId} and `status` <![CDATA[ <> ]]> 0 "+
" <if test='param.isAgentStaffAllot != null and param.isAgentStaffAllot == true'> and agent_staff_id = #{param.agentStaffId} and mer_id in (select mer_id from bs_agent_mer where agent_staff_id = #{param.agentStaffId} and `status` <![CDATA[ <> ]]> 0) </if>"+
" <if test='param.isAgentStaffAllot != null and param.isAgentStaffAllot == false'> and mer_id not in (select mer_id from bs_agent_mer where agent_staff_id = #{param.agentStaffId} and `status` <![CDATA[ <> ]]> 0) </if>"+
" GROUP BY mer_id) b on b.mer_id = a.id"+
" WHERE a.`status` <![CDATA[ <> 0 ]]> ) a "+
" WHERE 1 = 1 "+
" <if test='param.provinceCode != null'> and a.provinceCode = #{param.provinceCode} </if>"+
" <if test='param.merSourceType != null'> and a.merSourceType = #{param.merSourceType} </if>"+
" <if test='param.merNo != null'> and a.merNo like concat('%',#{param.merNo},'%') </if>"+
" <if test='param.merName != null'> and a.merName like concat('%',#{param.merName},'%') </if>"+
" <if test='param.isAgentAllot != null and param.isAgentAllot == true'> and a.agentId is not null </if>"+
" <if test='param.isAgentAllot != null and param.isAgentAllot == false'> and a.agentId is null </if>"+
" <if test='param.status != null'> and a.status = #{param.status} </if>"+