Commit 14dcfc12 by jscat

nyx javaapp: 功能更新

1. 添加功能GetV_activity_info_by_period, 按照时间段搜索活动, activity_list页面
2. 添加按照city字段搜索的功能
parent 26b8be8a
package cn.com.fun.nyxkey.api.domain.query; package cn.com.fun.nyxkey.api.domain.query;
...@@ -20,12 +20,15 @@ public class Rockwell_keyT_activityQuery { ...@@ -20,12 +20,15 @@ public class Rockwell_keyT_activityQuery {
private String activityId; // 活动id private String activityId; // 活动id
private String memberId; // 商家id private String memberId; // 商家id
private String memberName; // 商家名称 private String memberName; // 商家名称
private String city; // 城市名称
private String memberStatus; // 商家状态, 00: 未注册用户; 01: 已注册用户 private String memberStatus; // 商家状态, 00: 未注册用户; 01: 已注册用户
private String tag; // 发布的标签,比如: 酒单;;活动;;心情;;饮事;;最热Gluh Wein private String tag; // 发布的标签,比如: 酒单;;活动;;心情;;饮事;;最热Gluh Wein
private String title; // 发布标题,比如:此生必去系列。 private String title; // 发布标题,比如:此生必去系列。
private String curDate; // format: 202008 private String curDate; // format: 2020-08-03
private String beginDate; // format: 2020-08-10
private String endDate; // format: 2020-08-10
private Pagination pagination; private Pagination pagination;
...@@ -71,6 +74,18 @@ public class Rockwell_keyT_activityQuery { ...@@ -71,6 +74,18 @@ public class Rockwell_keyT_activityQuery {
} }
} }
public void setCity(String strCity)
{
if(strCity.equals("0"))
{
this.city = null;
}
else
{
this.city = strCity;
}
}
public void setMemberStatus(String strMemberStatus) public void setMemberStatus(String strMemberStatus)
{ {
if(strMemberStatus.equals("0")) if(strMemberStatus.equals("0"))
...@@ -119,6 +134,30 @@ public class Rockwell_keyT_activityQuery { ...@@ -119,6 +134,30 @@ public class Rockwell_keyT_activityQuery {
} }
} }
public void setBeginDate(String strBeginDate)
{
if(strBeginDate.equals("0"))
{
this.beginDate = null;
}
else
{
this.beginDate = strBeginDate;
}
}
public void setToDate(String strEndDate)
{
if(strEndDate.equals("0"))
{
this.endDate = null;
}
else
{
this.endDate = strEndDate;
}
}
@Override @Override
public String toString() { public String toString() {
...@@ -127,10 +166,13 @@ public class Rockwell_keyT_activityQuery { ...@@ -127,10 +166,13 @@ public class Rockwell_keyT_activityQuery {
"activityId='" + activityId + '\'' + "activityId='" + activityId + '\'' +
"memberId='" + memberId + '\'' + "memberId='" + memberId + '\'' +
"memberName='" + memberName + '\'' + "memberName='" + memberName + '\'' +
"city='" + city + '\'' +
"memberStatus='" + memberStatus + '\'' + "memberStatus='" + memberStatus + '\'' +
"tag='" + tag + '\'' + "tag='" + tag + '\'' +
"title='" + title + '\'' + "title='" + title + '\'' +
"curDate='" + curDate + '\'' + "curDate='" + curDate + '\'' +
"beginDate='" + beginDate + '\'' +
"endDate='" + endDate + '\'' +
"pagination='" + pagination + '\'' + "pagination='" + pagination + '\'' +
'}'; '}';
} }
......
package cn.com.fun.nyxkey.api.repository; package cn.com.fun.nyxkey.api.repository;
...@@ -35,6 +35,7 @@ public interface Rockwell_keyMapper { ...@@ -35,6 +35,7 @@ public interface Rockwell_keyMapper {
/* activity api */ /* activity api */
List<Rockwell_keyV_activity_info> getV_activity_info_by_page(Rockwell_keyT_activityQuery rockwell_keyT_activityQuery); List<Rockwell_keyV_activity_info> getV_activity_info_by_page(Rockwell_keyT_activityQuery rockwell_keyT_activityQuery);
List<Rockwell_keyV_activity_info> getV_activity_info_by_period(Rockwell_keyT_activityQuery rockwell_keyT_activityQuery);
List<Rockwell_keyV_activity_info> getV_activity_detail_by_id(Rockwell_keyT_activityQuery rockwell_keyT_activityQuery); List<Rockwell_keyV_activity_info> getV_activity_detail_by_id(Rockwell_keyT_activityQuery rockwell_keyT_activityQuery);
/* post api */ /* post api */
......
package cn.com.fun.nyxkey.api.service; package cn.com.fun.nyxkey.api.service;
...@@ -46,6 +46,9 @@ public interface Rockwell_keyService { ...@@ -46,6 +46,9 @@ public interface Rockwell_keyService {
JSONResult Rockwell_keyServiceGetV_activity_info(String tag, String title, JSONResult Rockwell_keyServiceGetV_activity_info(String tag, String title,
String memberId, String memberName, String memberStatus, String curDate, String memberId, String memberName, String memberStatus, String curDate,
int pageNum, int pageCount); int pageNum, int pageCount);
JSONResult Rockwell_keyServiceGetV_activity_info_by_period(String tag, String title, String memberId, String memberName, String city, String memberStatus,
String beginDate, String endDate, int pageNum, int pageCount);
JSONResult Rockwell_keyServiceGetV_activity_detail_by_id(String activityId); JSONResult Rockwell_keyServiceGetV_activity_detail_by_id(String activityId);
......
package cn.com.fun.nyxkey.api.service.impl; package cn.com.fun.nyxkey.api.service.impl;
...@@ -334,6 +334,39 @@ public class Rockwell_keyServiceImpl implements Rockwell_keyService { ...@@ -334,6 +334,39 @@ public class Rockwell_keyServiceImpl implements Rockwell_keyService {
return jsonResult; return jsonResult;
} }
public JSONResult Rockwell_keyServiceGetV_activity_info_by_period(String tag, String title, String memberId, String memberName, String city, String memberStatus,
String beginDate, String endDate, int pageNum, int pageCount)
{
LOGGER.debug("find Rockwell_keyServiceGetV_activity_info");
List<Rockwell_keyV_activity_info> listRockwell_keyV_activity_info = new ArrayList<>();
Rockwell_keyT_activityQuery rockwell_keyT_activityQuery = new Rockwell_keyT_activityQuery();
//判断某字符串是否为空,为空的标准是 str==null 或 str.length()==0
//默认设置memberStatus=="01"
if(StringUtils.isEmpty(memberStatus) || memberStatus.equals("0"))
{
rockwell_keyT_activityQuery.setMemberStatus("01");
}
else
{
rockwell_keyT_activityQuery.setMemberStatus(memberStatus);
}
rockwell_keyT_activityQuery.setMemberId(memberId);
rockwell_keyT_activityQuery.setMemberName(memberName);
rockwell_keyT_activityQuery.setCity(city);
rockwell_keyT_activityQuery.setTag(tag);
rockwell_keyT_activityQuery.setTitle(title);
rockwell_keyT_activityQuery.setBeginDate(beginDate);
rockwell_keyT_activityQuery.setEndDate(endDate);
rockwell_keyT_activityQuery.setPagination(new Pagination(pageNum, pageCount));
listRockwell_keyV_activity_info = rockwell_keyMapper.getV_activity_info_by_period(rockwell_keyT_activityQuery);
int totalCount = listRockwell_keyV_activity_info.size();
JSONResult jsonResult = new JSONResult(totalCount, listRockwell_keyV_activity_info);
return jsonResult;
}
/* activity api /* activity api
* 通过 activityId 来获取 view_activity_detail 的详细信息 * 通过 activityId 来获取 view_activity_detail 的详细信息
* *
......
package cn.com.fun.nyxkey.api.web.controller; package cn.com.fun.nyxkey.api.web.controller;
...@@ -300,6 +300,37 @@ public class NyxApiController { ...@@ -300,6 +300,37 @@ public class NyxApiController {
return keyService.Rockwell_keyServiceGetV_activity_detail_by_id(activityId); return keyService.Rockwell_keyServiceGetV_activity_detail_by_id(activityId);
} }
// APi3 tbl_activity接口 jscat 20200824
// 3.2 获取 view_activity_info 的数据 by period, not by activityId
// 返回 Rockwell_keyV_activity_info
@ApiOperation(value="获取商家的activity info by period", notes="获取商家的activity info by period")
@ApiImplicitParams({
@ApiImplicitParam(name = "tag", value = "按标签查找; 饮事", required = false, dataType = "String"),
@ApiImplicitParam(name = "title", value = "按标题查找: 清新", required = false, dataType = "String"),
@ApiImplicitParam(name = "memberId", value = "按商家id查找", required = false, dataType = "String"),
@ApiImplicitParam(name = "memberName", value = "按商家名称查找", required = false, dataType = "String"),
@ApiImplicitParam(name = "memberStatus", value = "按商家 状态查找", required = false, dataType = "String"),
@ApiImplicitParam(name = "beginDate", value = "按yyyy-mm-dd查找", required = true, dataType = "String"),
@ApiImplicitParam(name = "endDate", value = "按yyyy-mm-dd查找", required = true, dataType = "String"),
@ApiImplicitParam(name = "pageNum", value = "页码,从1开始", required = false, dataType = "String", defaultValue = "1"),
@ApiImplicitParam(name = "pageCount", value = "每页的数据个数,默认是4个", required = false, dataType = "String", defaultValue = "4")
})
@RequestMapping(value = "/nyx/activity/query/period", method = RequestMethod.GET)
public JSONResult RockwellQueryActivityByPeriod(
@RequestParam(value = "tag", required = false, defaultValue = "0") String tag,
@RequestParam(value = "title", required = false, defaultValue = "0") String title,
@RequestParam(value = "memberId", required = false, defaultValue = "0") String memberId,
@RequestParam(value = "memberName", required = false, defaultValue = "0") String memberName,
@RequestParam(value = "city", required = false, defaultValue = "0") String city,
@RequestParam(value = "memberStatus", required = false, defaultValue = "0") String memberStatus,
@RequestParam(value = "beginDate", required = false, defaultValue = "0") String beginDate,
@RequestParam(value = "endDate", required = false, defaultValue = "0") String endDate,
@RequestParam(value = "pageNum", required = false, defaultValue = "1") int pageNum,
@RequestParam(value = "pageCount", required = false, defaultValue = "4") int pageCount
) {
return keyService.Rockwell_keyServiceGetV_activity_info_by_period(tag, title, memberId, memberName, city, memberStatus, beginDate, endDate, pageNum, pageCount);
}
// 4.0 post info api // 4.0 post info api
@ApiOperation(value="获取用户的post info", notes="获取用户的post info") @ApiOperation(value="获取用户的post info", notes="获取用户的post info")
@ApiImplicitParams({ @ApiImplicitParams({
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
...@@ -262,6 +262,41 @@ limitations under the License. ...@@ -262,6 +262,41 @@ limitations under the License.
order by default_status desc, product_id asc; order by default_status desc, product_id asc;
</select> </select>
<!-- activity api 2-3 获取 v_activity_info 的值 by period update jscat 20200824 -->
<!-- 因为 activity_info 只需要显示 default_status="01"的商品 -->
<select id="getV_activity_info_by_period" parameterType="cn.com.fun.nyxkey.api.domain.query.Rockwell_keyT_activityQuery"
resultType="cn.com.fun.nyxkey.api.domain.Rockwell_keyV_activity_info">
select * from view_activity_info
where 1=1
<if test="memberId != null and memberId != '' ">
AND member_id=#{memberId}
</if>
<if test="memberStatus != null and memberStatus != '' ">
AND member_status=#{memberStatus}
</if>
<if test="memberName != null and memberName != '' ">
AND member_name=#{memberName}
</if>
<if test="city != null and city != '' ">
AND address_name LIKE CONCAT('%', #{city} ,'%')
</if>
<if test="tag != null and tag != '' ">
AND tag LIKE CONCAT('%', #{tag} ,'%')
</if>
<if test="title != null and title != '' ">
AND ( tag LIKE CONCAT('%', #{title} ,'%') OR title LIKE CONCAT('%', #{title} ,'%') OR member_name LIKE CONCAT('%', #{title} ,'%') )
</if>
<if test="beginDate != null and endDate!= null and beginDate != '' and endDate != '' ">
AND
(
#{endDate} &gt;= DATE_FORMAT(start_datetime,'%Y-%m-%d') AND #{beginDate} &lt;= DATE_FORMAT(end_datetime,'%Y-%m-%d')
)
</if>
<if test="pagination != null ">
<include refid="pagination"/>
</if>
</select>
<!-- post api 4.1 从 view_post_info 获取 post信息 <!-- post api 4.1 从 view_post_info 获取 post信息
--> -->
<select id="getV_post_info" parameterType="cn.com.fun.nyxkey.api.domain.query.Rockwell_keyT_postQuery" resultType="cn.com.fun.nyxkey.api.domain.Rockwell_keyV_post_info"> <select id="getV_post_info" parameterType="cn.com.fun.nyxkey.api.domain.query.Rockwell_keyT_postQuery" resultType="cn.com.fun.nyxkey.api.domain.Rockwell_keyV_post_info">
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论