|
|
|
package com.hai.dao;
|
|
|
|
|
|
|
|
import com.hai.model.TyAgentOilStationModel;
|
|
|
|
import org.apache.ibatis.annotations.Param;
|
|
|
|
import org.apache.ibatis.annotations.Select;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* mapper扩展类
|
|
|
|
*/
|
|
|
|
public interface HighTyAgentOilStationMapperExt {
|
|
|
|
|
|
|
|
@Select("<script>" +
|
|
|
|
" select " +
|
|
|
|
" a.id storeId," +
|
|
|
|
" a.region_id regionId," +
|
|
|
|
" a.region_name regionName," +
|
|
|
|
" a.store_logo storeLogo," +
|
|
|
|
" a.store_key storeKey," +
|
|
|
|
" a.store_name storeName," +
|
|
|
|
" a.address," +
|
|
|
|
" b.id tyAgentOilStationId," +
|
|
|
|
" b.organization_id organizationId, " +
|
|
|
|
" b.organization_name organizationName, " +
|
|
|
|
" b.ty_agent_id tyAgentId," +
|
|
|
|
" b.ty_agent_name tyAgentName," +
|
|
|
|
" b.ty_salesman_id tySalesmanId," +
|
|
|
|
" b.ty_salesman_name tySalesmanName," +
|
|
|
|
" b.oil_station_id oilStationId," +
|
|
|
|
" b.oil_station_name oilStationName" +
|
|
|
|
" from high_merchant_store a" +
|
|
|
|
" LEFT JOIN high_ty_agent_oil_station b on a.id = b.oil_station_id and b.`status` = 1" +
|
|
|
|
" where a.type = 1 and a.`status` = 1" +
|
|
|
|
" <if test='param.regionName != null'> and a.region_name like concat('%',#{param.regionName},'%') </if>" +
|
|
|
|
" <if test='param.storeName != null'> and a.store_name like concat('%',#{param.storeName},'%') </if>" +
|
|
|
|
" <if test='param.isAssignOrgId != null and param.isAssignOrgId == true'> and b.organization_id is not null </if>" +
|
|
|
|
" <if test='param.isAssignOrgId != null and param.isAssignOrgId == false'> and b.organization_id is null </if>" +
|
|
|
|
" <if test='param.organizationId != null'> and b.organization_id = #{param.organizationId} </if>" +
|
|
|
|
" <if test='param.organizationName != null'> and b.organization_name = #{param.organizationName} </if>" +
|
|
|
|
" <if test='param.isAssignTyAgent != null and param.isAssignTyAgent == true'> and b.ty_agent_id is not null </if>" +
|
|
|
|
" <if test='param.isAssignTyAgent != null and param.isAssignTyAgent == false'> and b.ty_agent_id is null </if>" +
|
|
|
|
" <if test='param.tyAgentId != null'> and b.ty_agent_id = #{param.tyAgentId} </if>" +
|
|
|
|
" <if test='param.tyAgentName != null'> and a.ty_agent_name like concat('%',#{param.tyAgentName},'%') </if>" +
|
|
|
|
" <if test='param.isAssignTySalesman != null and param.isAssignTySalesman == true'> and b.ty_salesman_id is not null </if>" +
|
|
|
|
" <if test='param.isAssignTySalesman != null and param.isAssignTySalesman == false'> and b.ty_salesman_id is null </if>" +
|
|
|
|
" <if test='param.tySalesmanId != null'> and b.ty_salesman_id = #{param.tySalesmanId} </if>" +
|
|
|
|
" <if test='param.tySalesmanName != null'> and a.ty_salesman_name like concat('%',#{param.tySalesmanName},'%') </if>" +
|
|
|
|
" ORDER BY a.id desc" +
|
|
|
|
"</script>")
|
|
|
|
List<TyAgentOilStationModel> queryOilStationList(@Param("param") Map<String, Object> param);
|
|
|
|
|
|
|
|
}
|