| @@ -0,0 +1,28 @@ | |||||
| package com.iformall.controller.sys; | |||||
| import com.iformall.common.ResultData; | |||||
| import com.iformall.controller.base.BaseController; | |||||
| import com.iformall.service.SysGaoDeService; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| /** | |||||
| * @author gongbiao | |||||
| */ | |||||
| @RestController | |||||
| @RequestMapping("/api/sysGaode") | |||||
| public class SysGaodeController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private SysGaoDeService sysGaoDeService; | |||||
| @GetMapping("getAll") | |||||
| public ResultData getAll() { | |||||
| return new ResultData(sysGaoDeService.getAll()); | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,9 @@ | |||||
| alter table sys_gaode_city add column type int(1) NOT NULL COMMENT '类型EnumGaodeCityType' ; | |||||
| alter table sys_gaode_city add column parent_id bigint(11) COMMENT '父级' ; | |||||
| ###重新导出数据#### | |||||
| @@ -28,4 +28,8 @@ public class SysGaodeCity extends BaseEntity { | |||||
| private Integer isHide; | private Integer isHide; | ||||
| @io.swagger.annotations.ApiModelProperty(value="0-有效 1-无效",name="status") | @io.swagger.annotations.ApiModelProperty(value="0-有效 1-无效",name="status") | ||||
| private Integer status; | private Integer status; | ||||
| @io.swagger.annotations.ApiModelProperty(value="类型EnumGaodeCityType",name="type") | |||||
| private Integer type; | |||||
| @io.swagger.annotations.ApiModelProperty(value="父级",name="parentId") | |||||
| private Long parentId; | |||||
| } | } | ||||
| @@ -0,0 +1,36 @@ | |||||
| package com.iformall.enums; | |||||
| /** | |||||
| * @author gongbiao | |||||
| */ | |||||
| public enum EnumGaodeCityType { | |||||
| PROVINCE(1, "省"), | |||||
| CITY(2, "市"); | |||||
| public static EnumGaodeCityType getEnum(Integer code) { | |||||
| for (EnumGaodeCityType value : values()) { | |||||
| if (value.getCode().equals(code)) { | |||||
| return value; | |||||
| } | |||||
| } | |||||
| return null; | |||||
| } | |||||
| private Integer code; | |||||
| private String message; | |||||
| EnumGaodeCityType(Integer code, String message) { | |||||
| this.code = code; | |||||
| this.message = message; | |||||
| } | |||||
| public Integer getCode() { | |||||
| return code; | |||||
| } | |||||
| public String getMessage() { | |||||
| return message; | |||||
| } | |||||
| } | |||||
| @@ -1,7 +1,10 @@ | |||||
| package com.iformall.service; | package com.iformall.service; | ||||
| import java.util.List; | |||||
| import java.util.Map; | import java.util.Map; | ||||
| import com.iformall.domain.po.SysGaodeCity; | |||||
| public interface SysGaoDeService { | public interface SysGaoDeService { | ||||
| /** | /** | ||||
| @@ -12,4 +15,6 @@ public interface SysGaoDeService { | |||||
| */ | */ | ||||
| Map<String,String> getAllCityLabelMap(); | Map<String,String> getAllCityLabelMap(); | ||||
| List<SysGaodeCity> getAll(); | |||||
| } | } | ||||
| @@ -4,6 +4,7 @@ import java.util.*; | |||||
| import com.iformall.domain.po.SysGaodeCity; | import com.iformall.domain.po.SysGaodeCity; | ||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.enums.EnumDelStatus; | import com.iformall.enums.EnumDelStatus; | ||||
| import com.iformall.enums.EnumGaodeCityType; | |||||
| import com.iformall.enums.EnumYesOrNo; | import com.iformall.enums.EnumYesOrNo; | ||||
| import com.iformall.mapper.SysGaodeCityMapper; | import com.iformall.mapper.SysGaodeCityMapper; | ||||
| import com.iformall.service.SysGaoDeService; | import com.iformall.service.SysGaoDeService; | ||||
| @@ -42,4 +43,12 @@ public class SysGaoDeServiceImpl implements SysGaoDeService { | |||||
| } | } | ||||
| return cacheMap; | return cacheMap; | ||||
| } | } | ||||
| @Override | |||||
| public List<SysGaodeCity> getAll() { | |||||
| SysGaodeCity sgc = new SysGaodeCity(); | |||||
| sgc.setIsHide(EnumYesOrNo.NO.getCode()); | |||||
| sgc.setStatus(EnumDelStatus.NOT_DEL.getCode()); | |||||
| return sysGaodeCityMapper.findList(sgc); | |||||
| } | |||||
| } | } | ||||
| @@ -9,10 +9,12 @@ | |||||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> | <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> | ||||
| <result column="is_hide" jdbcType="INTEGER" property="isHide" /> | <result column="is_hide" jdbcType="INTEGER" property="isHide" /> | ||||
| <result column="status" jdbcType="INTEGER" property="status" /> | <result column="status" jdbcType="INTEGER" property="status" /> | ||||
| <result column="type" jdbcType="INTEGER" property="type" /> | |||||
| <result column="parent_id" jdbcType="BIGINT" property="parentId" /> | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`name`,`label`,`create_date`,`update_date`,`is_hide`,`status` | |||||
| `id`,`name`,`label`,`create_date`,`update_date`,`is_hide`,`status`,`type`,`parent_id` | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| @@ -29,6 +31,12 @@ | |||||
| <if test=" null != status "> | <if test=" null != status "> | ||||
| and `status` = #{status} | and `status` = #{status} | ||||
| </if> | </if> | ||||
| <if test=" null != type "> | |||||
| and `type` = #{type} | |||||
| </if> | |||||
| <if test=" null != parentId "> | |||||
| and `parent_id` = #{parentId} | |||||
| </if> | |||||
| <if test=" null != ids "> | <if test=" null != ids "> | ||||
| and id in | and id in | ||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | ||||
| @@ -84,9 +84,17 @@ | |||||
| and `poi_name` like concat('%', #{poiName},'%') | and `poi_name` like concat('%', #{poiName},'%') | ||||
| </if> | </if> | ||||
| <if test=" null != province and ''!= province "> | |||||
| and `province` like concat('%', #{province},'%') | |||||
| </if> | |||||
| <if test=" null != city and ''!= city "> | <if test=" null != city and ''!= city "> | ||||
| and `city` like concat('%', #{city},'%') | and `city` like concat('%', #{city},'%') | ||||
| </if> | </if> | ||||
| <if test=" null != address and ''!= address "> | |||||
| and `address` like concat('%', #{address},'%') | |||||
| </if> | |||||
| <if test=" null != merchantName and ''!= merchantName "> | <if test=" null != merchantName and ''!= merchantName "> | ||||
| and `merchant_name` like concat('%', #{merchantName},'%') | and `merchant_name` like concat('%', #{merchantName},'%') | ||||