Commit 07233313 authored by 周健威's avatar 周健威

Merge branch 'master-vehicle-price' into dev-tiande

parents 091db407 80a92e6b
package com.xxfc.platform.vehicle.pojo;
import lombok.Data;
@Data
public class CompanySearchOldDTO {
Integer page;
Integer limit;
Integer addrCity;
String lon;
String lat;
Integer state;
Integer isShow = 1;
Integer isDel = 0;
}
\ No newline at end of file
...@@ -24,10 +24,7 @@ import com.xxfc.platform.vehicle.entity.BranchCompany; ...@@ -24,10 +24,7 @@ import com.xxfc.platform.vehicle.entity.BranchCompany;
import com.xxfc.platform.vehicle.entity.BranchCompanyStockInfo; import com.xxfc.platform.vehicle.entity.BranchCompanyStockInfo;
import com.xxfc.platform.vehicle.entity.SysRegion; import com.xxfc.platform.vehicle.entity.SysRegion;
import com.xxfc.platform.vehicle.mapper.BranchCompanyMapper; import com.xxfc.platform.vehicle.mapper.BranchCompanyMapper;
import com.xxfc.platform.vehicle.pojo.BranchCompanyVo; import com.xxfc.platform.vehicle.pojo.*;
import com.xxfc.platform.vehicle.pojo.CompanyDetail;
import com.xxfc.platform.vehicle.pojo.CompanySearchDTO;
import com.xxfc.platform.vehicle.pojo.CompanySearchVO;
import com.xxfc.platform.vehicle.pojo.dto.BranchCompanyAreaDTO; import com.xxfc.platform.vehicle.pojo.dto.BranchCompanyAreaDTO;
import com.xxfc.platform.vehicle.pojo.dto.BranchCompanyFindDTO; import com.xxfc.platform.vehicle.pojo.dto.BranchCompanyFindDTO;
import com.xxfc.platform.vehicle.pojo.dto.BranchCompanyListDTO; import com.xxfc.platform.vehicle.pojo.dto.BranchCompanyListDTO;
...@@ -225,6 +222,12 @@ public class BranchCompanyBiz extends BaseBiz<BranchCompanyMapper, BranchCompany ...@@ -225,6 +222,12 @@ public class BranchCompanyBiz extends BaseBiz<BranchCompanyMapper, BranchCompany
return PageDataVO.pageInfo(branchCompanyPageInfo); return PageDataVO.pageInfo(branchCompanyPageInfo);
} }
public PageDataVO<BranchCompany> searchOld(CompanySearchOldDTO vo) {
PageHelper.startPage(vo.getPage(), vo.getLimit());
PageInfo<BranchCompany> branchCompanyPageInfo = new PageInfo<>(mapper.searchOld(vo.getLon(), vo.getLat(), vo.getAddrCity(), vo.getState(), vo.getIsShow(), vo.getIsDel()));
return PageDataVO.pageInfo(branchCompanyPageInfo);
}
public PageDataVO<CompanySearchVO> search(CompanySearchDTO vo) { public PageDataVO<CompanySearchVO> search(CompanySearchDTO vo) {
PageHelper.startPage(vo.getPage(), vo.getLimit()); PageHelper.startPage(vo.getPage(), vo.getLimit());
PageInfo<CompanySearchVO> branchCompanyPageInfo = new PageInfo<>(getList(vo)); PageInfo<CompanySearchVO> branchCompanyPageInfo = new PageInfo<>(getList(vo));
......
...@@ -15,6 +15,7 @@ import java.util.List; ...@@ -15,6 +15,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
public interface BranchCompanyMapper extends Mapper<BranchCompany>, SelectByIdListMapper<BranchCompany,Integer> { public interface BranchCompanyMapper extends Mapper<BranchCompany>, SelectByIdListMapper<BranchCompany,Integer> {
List<BranchCompany> searchOld(@Param("lon") String lon, @Param("lat") String lat, @Param("addrCity") Integer addrCity, Integer state, Integer isShow, Integer isDel);
List<CompanySearchVO> search(CompanySearchDTO companySearchDTO); List<CompanySearchVO> search(CompanySearchDTO companySearchDTO);
List<BranchCompany> selectByZoneId(Map<String, Object> param); List<BranchCompany> selectByZoneId(Map<String, Object> param);
......
...@@ -16,10 +16,7 @@ import com.xxfc.platform.vehicle.common.RestResponse; ...@@ -16,10 +16,7 @@ import com.xxfc.platform.vehicle.common.RestResponse;
import com.xxfc.platform.vehicle.constant.ResCode.ResCode; import com.xxfc.platform.vehicle.constant.ResCode.ResCode;
import com.xxfc.platform.vehicle.entity.Area; import com.xxfc.platform.vehicle.entity.Area;
import com.xxfc.platform.vehicle.entity.BranchCompany; import com.xxfc.platform.vehicle.entity.BranchCompany;
import com.xxfc.platform.vehicle.pojo.BranchCompanyVo; import com.xxfc.platform.vehicle.pojo.*;
import com.xxfc.platform.vehicle.pojo.CompanyDetail;
import com.xxfc.platform.vehicle.pojo.CompanySearchDTO;
import com.xxfc.platform.vehicle.pojo.CompanySearchVO;
import com.xxfc.platform.vehicle.pojo.dto.BranchCompanyAreaDTO; import com.xxfc.platform.vehicle.pojo.dto.BranchCompanyAreaDTO;
import com.xxfc.platform.vehicle.pojo.dto.BranchCompanyFindDTO; import com.xxfc.platform.vehicle.pojo.dto.BranchCompanyFindDTO;
import com.xxfc.platform.vehicle.pojo.vo.BranComanyLeaderVo; import com.xxfc.platform.vehicle.pojo.vo.BranComanyLeaderVo;
...@@ -248,4 +245,11 @@ public class BranchCompanyController extends BaseController<BranchCompanyBiz> { ...@@ -248,4 +245,11 @@ public class BranchCompanyController extends BaseController<BranchCompanyBiz> {
return ObjectRestResponse.succ(baseBiz.getList(vo)); return ObjectRestResponse.succ(baseBiz.getList(vo));
} }
@RequestMapping(value ="/search",method = RequestMethod.GET)
@IgnoreUserToken
@IgnoreClientToken
public RestResponse<PageDataVO<BranchCompany>> search(@Validated CompanySearchOldDTO vo) {
return RestResponse.data(baseBiz.searchOld(vo));
}
} }
...@@ -24,6 +24,35 @@ ...@@ -24,6 +24,35 @@
<result column="state" property="state"/> <result column="state" property="state"/>
</resultMap> </resultMap>
<select id="searchOld" resultType="com.xxfc.platform.vehicle.pojo.CompanySearchVO">
select *
<if test="lon != null and lat != null">
, st_distance_sphere(point(#{lon}, #{lat}), point(longitude, latitude)) as distance
</if>
from branch_company
<where>
<if test="addrCity != null">
and (addr_city = #{addrCity} or addr_province = #{addrCity} or addr_town = #{addrCity})
</if>
<if test="lon != null and lat != null">
and longitude is not null and latitude is not null
</if>
<if test="state != null">
and state = #{state}
</if>
<if test="isShow != null">
and is_show = #{isShow}
</if>
<if test="isDel != null">
and is_del = #{isDel}
</if>
</where>
<if test="lon != null and lat != null">
order by distance asc
</if>
</select>
<select id="search" parameterType="com.xxfc.platform.vehicle.pojo.CompanySearchDTO" resultType="com.xxfc.platform.vehicle.pojo.CompanySearchVO"> <select id="search" parameterType="com.xxfc.platform.vehicle.pojo.CompanySearchDTO" resultType="com.xxfc.platform.vehicle.pojo.CompanySearchVO">
select c.*,i.name as companyName select c.*,i.name as companyName
<if test="lon != null and lat != null"> <if test="lon != null and lat != null">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment