Commit 89ac4d5d by jscat

nyx: 为map模块添加功能组件

parent fcea69eb
package cn.com.fun.nyxkey.api.domain;
package cn.com.fun.nyxkey.api.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* 地区-已复工用户表
* Created by jscat on 2020/03/26.
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Rockwell_keyV_area_total{
private String id; // id autoincrement
private String code; // 省份代码
private String province; // 省份名
private String city; // 城市名
private String district; // 地区名
private String url; // 该区地区
private String numBar; // 已复工数目
}
package cn.com.fun.nyxkey.api.domain;
package cn.com.fun.nyxkey.api.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* 发布-用户信息系视图表
* Created by jscat on 2020/03/26.
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Rockwell_keyV_member_pos{
private String id; // 商户的id, uuid format
private String memberStatus; // 用户状态: 0: 未注册用户; 1: 已注册用户
private String memberName; // 名称
private String memberAddress; // 地址
private Double lon; // lon
private Double lat; // lat
private String geoCode; // geohash编码
private int areaId; //地区码
private String areaName; // 地区名称
private String posLeft; // left位置
private String posTop; // top位置
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date createDatetime; // 统计周期
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date updateDatetime; // 更新日期
}
package cn.com.fun.nyxkey.api.domain.query;
package cn.com.fun.nyxkey.api.domain.query;
import cn.com.fun.nyxkey.api.common.Pagination;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* Created by jscat on 2020/03/27.
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Rockwell_keyT_areaQuery {
private String city;
private int areaId;
private String areaName;
public void setCity(String strCity)
{
if(strCity.equals("null") || strCity.equals("0") )
{
this.city = null;
}
else
{
this.city = strCity;
}
}
public void setAreaId(int areaId)
{
if( String.valueOf(areaId).equals("0"))
{
this.areaId = 0;
}
else
{
this.areaId = areaId;
}
}
public void setAreaName(String strAreaName)
{
if(strAreaName.equals("null") || strAreaName.equals("0"))
{
this.areaName = null;
}
else
{
this.areaName = strAreaName;
}
}
@Override
public String toString() {
return "Rockwell_keyT_areaQuery{" +
"areaName='" + areaName + '\'' +
"areaId='" + areaId + '\'' +
"city='" + city + '\'' +
'}';
}
}
package cn.com.fun.nyxkey.api.repository;
package cn.com.fun.nyxkey.api.repository;
......@@ -37,6 +37,11 @@ public interface Rockwell_keyMapper {
/* post api */
List<Rockwell_keyV_post_info> getV_post_info(Rockwell_keyT_postQuery rockwell_keyT_postQuery);
/* area api */
List<Rockwell_keyV_area_total> getCityList();
List<Rockwell_keyV_area_total> getCityInfo(Rockwell_keyT_areaQuery rockwell_keyT_areaQuery);
List<Rockwell_keyV_member_pos> getMemberPos(Rockwell_keyT_areaQuery rockwell_keyT_areaQuery);
/* testing */
void test(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
......
package cn.com.fun.nyxkey.api.service;
package cn.com.fun.nyxkey.api.service;
......@@ -43,6 +43,11 @@ public interface Rockwell_keyService {
/* post api */
JSONResult Rockwell_keyServiceGetV_post_info(String tag, String title, String top, int pageNum, int pageCount);
/* member pos api */
JSONResult Rockwell_keyServiceGetCityList();
JSONResult Rockwell_keyServiceGetCityInfo(String city);
JSONResult Rockwell_keyServiceGetMemberPos(int areaId, String areaName);
// testing
void Rockwell_keyServiceTest(List<Rockwell_keyT_match> listRockwell_keyT_match);
......
package cn.com.fun.nyxkey.api.service.impl;
package cn.com.fun.nyxkey.api.service.impl;
......@@ -289,6 +289,42 @@ public class Rockwell_keyServiceImpl implements Rockwell_keyService {
return jsonResult;
}
/* member pos api */
public JSONResult Rockwell_keyServiceGetCityList()
{
List<Rockwell_keyV_area_total> listRockwell_keyV_area_total= new ArrayList<Rockwell_keyV_area_total>();
listRockwell_keyV_area_total = rockwell_keyMapper.getCityList();
int totalCount = listRockwell_keyV_area_total.size();
JSONResult jsonResult = new JSONResult(totalCount, listRockwell_keyV_area_total);
return jsonResult;
}
public JSONResult Rockwell_keyServiceGetCityInfo(String city)
{
Rockwell_keyT_areaQuery rockwell_keyT_areaQuery = new Rockwell_keyT_areaQuery();
rockwell_keyT_areaQuery.setCity(city);
List<Rockwell_keyV_area_total> listRockwell_keyV_area_total= new ArrayList<Rockwell_keyV_area_total>();
listRockwell_keyV_area_total = rockwell_keyMapper.getCityInfo(rockwell_keyT_areaQuery);
int totalCount = listRockwell_keyV_area_total.size();
JSONResult jsonResult = new JSONResult(totalCount, listRockwell_keyV_area_total);
return jsonResult;
}
public JSONResult Rockwell_keyServiceGetMemberPos(int areaId, String areaName)
{
Rockwell_keyT_areaQuery rockwell_keyT_areaQuery = new Rockwell_keyT_areaQuery();
rockwell_keyT_areaQuery.setAreaId(areaId);
rockwell_keyT_areaQuery.setAreaName(areaName);
List<Rockwell_keyV_member_pos> listRockwell_keyV_member_pos= new ArrayList<Rockwell_keyV_member_pos>();
listRockwell_keyV_member_pos = rockwell_keyMapper.getMemberPos(rockwell_keyT_areaQuery);
int totalCount = listRockwell_keyV_member_pos.size();
JSONResult jsonResult = new JSONResult(totalCount, listRockwell_keyV_member_pos);
return jsonResult;
}
// testing
public void Rockwell_keyServiceTest(List<Rockwell_keyT_match> listRockwell_keyT_match)
......
package cn.com.fun.nyxkey.api.web.controller;
package cn.com.fun.nyxkey.api.web.controller;
......@@ -263,6 +263,43 @@ public class NyxApiController {
return keyService.Rockwell_keyServiceGetV_post_info(tag, title, top, pageNum, pageCount);
}
// 5.0 member pos api
@ApiOperation(value="获取citylist", notes="获取citylist")
@ApiImplicitParams({})
@RequestMapping(value = "/nyx/citylist/query", method = RequestMethod.GET)
public JSONResult RockwellQueryCityList(
) {
return keyService.Rockwell_keyServiceGetCityList();
}
// 5.0 post info api
@ApiOperation(value="获取 city info", notes="获取 city info")
@ApiImplicitParams({
@ApiImplicitParam(name = "city", value = "城市名", required = false, dataType = "String")
})
@RequestMapping(value = "/nyx/city/query", method = RequestMethod.GET)
public JSONResult RockwellQueryPost(
@RequestParam(value = "city", required = false, defaultValue = "0") String city
) {
return keyService.Rockwell_keyServiceGetCityInfo(city);
}
// 5.0 post info api
@ApiOperation(value="获取member的pos", notes="获取member的pos")
@ApiImplicitParams({
@ApiImplicitParam(name = "areaId", value = "地区id", required = false, dataType = "String"),
@ApiImplicitParam(name = "areaName", value = "地区名称", required = false, dataType = "String"),
})
@RequestMapping(value = "/nyx/member/pos/query", method = RequestMethod.GET)
public JSONResult RockwellQueryPost(
@RequestParam(value = "areaId", required = false, defaultValue = "0") int areaId,
@RequestParam(value = "areaName", required = false, defaultValue = "0") String areaName
) {
return keyService.Rockwell_keyServiceGetMemberPos(areaId,areaName);
}
// 2.0 test
@ApiOperation(value="test", notes="test")
......
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
......@@ -258,5 +258,36 @@ limitations under the License.
</if>
</select>
<!-- post api 4.1 从 view_post_info 获取 post信息
-->
<select id="getCityList" resultType="cn.com.fun.nyxkey.api.domain.Rockwell_keyV_area_total">
SELECT DISTINCT(city) FROM view_area_total
</select>
<!-- post api 4.1 从 view_post_info 获取 post信息
-->
<select id="getCityInfo" parameterType="cn.com.fun.nyxkey.api.domain.query.Rockwell_keyT_areaQuery" resultType="cn.com.fun.nyxkey.api.domain.Rockwell_keyV_area_total">
SELECT * FROM view_area_total
WHERE 1=1
AND city=#{city}
order by city asc
</select>
<!-- post api 4.1 从 view_post_info 获取 post信息
-->
<select id="getMemberPos" parameterType="cn.com.fun.nyxkey.api.domain.query.Rockwell_keyT_areaQuery" resultType="cn.com.fun.nyxkey.api.domain.Rockwell_keyV_member_pos">
SELECT * FROM view_member_pos
WHERE 1=1
<if test="areaId != 0 ">
AND area_id = #{areaId}f
</if>
<if test="areaName != null and areaName != '' ">
AND area_name = #{areaName}
</if>
order by area_name asc
</select>
<!-- ending API interface -->
</mapper>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论