Commit 5de6b90e by jscat

nyx javaapp: 数据优化

1. 为活动添加精简标题(6字以内)
2. 为order查询添加类似 00::20的查询方式  ids字段
3. 为活动查询添加日期范围查询 curDate字段
4.
parent c4be01c5
package cn.com.fun.nyxkey.api.domain; package cn.com.fun.nyxkey.api.domain;
...@@ -24,6 +24,7 @@ public class Rockwell_keyV_activity_info{ ...@@ -24,6 +24,7 @@ public class Rockwell_keyV_activity_info{
private String tag; // 活动的标签 private String tag; // 活动的标签
private String title; // 活动的标题 private String title; // 活动的标题
private String titleAbbr; // 活动的标题.简称
private String numLike; // 针对每条activity的点赞次数,每点一次,则累加 private String numLike; // 针对每条activity的点赞次数,每点一次,则累加
private String content; // 活动内容 private String content; // 活动内容
private String quiz; // quiz题目列表, 通过::做间隔, private String quiz; // quiz题目列表, 通过::做间隔,
......
package cn.com.fun.nyxkey.api.domain.query; package cn.com.fun.nyxkey.api.domain.query;
...@@ -25,6 +25,8 @@ public class Rockwell_keyT_activityQuery { ...@@ -25,6 +25,8 @@ public class Rockwell_keyT_activityQuery {
private String tag; // 发布的标签,比如: 酒单;;活动;;心情;;饮事;;最热Gluh Wein private String tag; // 发布的标签,比如: 酒单;;活动;;心情;;饮事;;最热Gluh Wein
private String title; // 发布标题,比如:此生必去系列。 private String title; // 发布标题,比如:此生必去系列。
private String curDate; // format: 202008
private Pagination pagination; private Pagination pagination;
//默认返回1页4条记录 //默认返回1页4条记录
...@@ -105,6 +107,18 @@ public class Rockwell_keyT_activityQuery { ...@@ -105,6 +107,18 @@ public class Rockwell_keyT_activityQuery {
} }
} }
public void setCurDate(String strCurDate)
{
if(strCurDate.equals("0"))
{
this.curDate = null;
}
else
{
this.curDate = strCurDate;
}
}
@Override @Override
public String toString() { public String toString() {
...@@ -116,6 +130,7 @@ public class Rockwell_keyT_activityQuery { ...@@ -116,6 +130,7 @@ public class Rockwell_keyT_activityQuery {
"memberStatus='" + memberStatus + '\'' + "memberStatus='" + memberStatus + '\'' +
"tag='" + tag + '\'' + "tag='" + tag + '\'' +
"title='" + title + '\'' + "title='" + title + '\'' +
"curDate='" + curDate + '\'' +
"pagination='" + pagination + '\'' + "pagination='" + pagination + '\'' +
'}'; '}';
} }
......
package cn.com.fun.nyxkey.api.domain.query; package cn.com.fun.nyxkey.api.domain.query;
...@@ -21,6 +21,7 @@ public class Rockwell_keyT_orderQuery { ...@@ -21,6 +21,7 @@ public class Rockwell_keyT_orderQuery {
private String memberId; // 商家id private String memberId; // 商家id
private String userId; // 用户名称 private String userId; // 用户名称
private String orderStatus; // 订单状态: 00-订单取消, 10-未付款, 20-可使用, 30-已完成 private String orderStatus; // 订单状态: 00-订单取消, 10-未付款, 20-可使用, 30-已完成
private List<String> ids; // 订单状态: 00-订单取消, 10-未付款, 20-可使用, 30-已完成
private String title; // 发布标题,比如:此生必去系列。 private String title; // 发布标题,比如:此生必去系列。
...@@ -102,6 +103,7 @@ public class Rockwell_keyT_orderQuery { ...@@ -102,6 +103,7 @@ public class Rockwell_keyT_orderQuery {
"userId='" + userId + '\'' + "userId='" + userId + '\'' +
"orderStatus='" + orderStatus + '\'' + "orderStatus='" + orderStatus + '\'' +
"title='" + title + '\'' + "title='" + title + '\'' +
"ids='" + ids + '\'' +
"pagination='" + pagination + '\'' + "pagination='" + pagination + '\'' +
'}'; '}';
} }
......
package cn.com.fun.nyxkey.api.service; package cn.com.fun.nyxkey.api.service;
...@@ -44,7 +44,7 @@ public interface Rockwell_keyService { ...@@ -44,7 +44,7 @@ public interface Rockwell_keyService {
activity api activity api
*/ */
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 memberId, String memberName, String memberStatus, String curDate,
int pageNum, int pageCount); 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;
...@@ -303,7 +303,7 @@ public class Rockwell_keyServiceImpl implements Rockwell_keyService { ...@@ -303,7 +303,7 @@ public class Rockwell_keyServiceImpl implements Rockwell_keyService {
public JSONResult Rockwell_keyServiceGetV_activity_info(String tag, String title, public JSONResult Rockwell_keyServiceGetV_activity_info(String tag, String title,
String memberId, String memberName, String memberStatus, String memberId, String memberName, String memberStatus, String curDate,
int pageNum, int pageCount) int pageNum, int pageCount)
{ {
LOGGER.debug("find Rockwell_keyServiceGetV_activity_info"); LOGGER.debug("find Rockwell_keyServiceGetV_activity_info");
...@@ -325,6 +325,7 @@ public class Rockwell_keyServiceImpl implements Rockwell_keyService { ...@@ -325,6 +325,7 @@ public class Rockwell_keyServiceImpl implements Rockwell_keyService {
rockwell_keyT_activityQuery.setMemberName(memberName); rockwell_keyT_activityQuery.setMemberName(memberName);
rockwell_keyT_activityQuery.setTag(tag); rockwell_keyT_activityQuery.setTag(tag);
rockwell_keyT_activityQuery.setTitle(title); rockwell_keyT_activityQuery.setTitle(title);
rockwell_keyT_activityQuery.setCurDate(curDate);
rockwell_keyT_activityQuery.setPagination(new Pagination(pageNum, pageCount)); rockwell_keyT_activityQuery.setPagination(new Pagination(pageNum, pageCount));
listRockwell_keyV_activity_info = rockwell_keyMapper.getV_activity_info_by_page(rockwell_keyT_activityQuery); listRockwell_keyV_activity_info = rockwell_keyMapper.getV_activity_info_by_page(rockwell_keyT_activityQuery);
...@@ -430,7 +431,9 @@ public class Rockwell_keyServiceImpl implements Rockwell_keyService { ...@@ -430,7 +431,9 @@ public class Rockwell_keyServiceImpl implements Rockwell_keyService {
// } // }
rockwell_keyT_orderQuery.setUserId(userId); rockwell_keyT_orderQuery.setUserId(userId);
rockwell_keyT_orderQuery.setOrderStatus(orderStatus); // rockwell_keyT_orderQuery.setOrderStatus(orderStatus);
List<String> ids = Arrays.asList(orderStatus.split("::"));
rockwell_keyT_orderQuery.setIds(ids);
rockwell_keyT_orderQuery.setPagination(new Pagination(pageNum, pageCount)); rockwell_keyT_orderQuery.setPagination(new Pagination(pageNum, pageCount));
listRockwell_keyV_order_info = rockwell_keyMapper.getV_order_detail_by_page(rockwell_keyT_orderQuery); listRockwell_keyV_order_info = rockwell_keyMapper.getV_order_detail_by_page(rockwell_keyT_orderQuery);
......
package cn.com.fun.nyxkey.api.web.controller; package cn.com.fun.nyxkey.api.web.controller;
...@@ -269,6 +269,7 @@ public class NyxApiController { ...@@ -269,6 +269,7 @@ public class NyxApiController {
@ApiImplicitParam(name = "memberId", value = "按商家id查找", required = false, dataType = "String"), @ApiImplicitParam(name = "memberId", value = "按商家id查找", required = false, dataType = "String"),
@ApiImplicitParam(name = "memberName", value = "按商家名称查找", required = false, dataType = "String"), @ApiImplicitParam(name = "memberName", value = "按商家名称查找", required = false, dataType = "String"),
@ApiImplicitParam(name = "memberStatus", value = "按商家 状态查找", required = false, dataType = "String"), @ApiImplicitParam(name = "memberStatus", value = "按商家 状态查找", required = false, dataType = "String"),
@ApiImplicitParam(name = "curDate", value = "按月份查找", required = false, dataType = "String"),
@ApiImplicitParam(name = "pageNum", value = "页码,从1开始", required = false, dataType = "String", defaultValue = "1"), @ApiImplicitParam(name = "pageNum", value = "页码,从1开始", required = false, dataType = "String", defaultValue = "1"),
@ApiImplicitParam(name = "pageCount", value = "每页的数据个数,默认是4个", required = false, dataType = "String", defaultValue = "4") @ApiImplicitParam(name = "pageCount", value = "每页的数据个数,默认是4个", required = false, dataType = "String", defaultValue = "4")
}) })
...@@ -279,10 +280,11 @@ public class NyxApiController { ...@@ -279,10 +280,11 @@ public class NyxApiController {
@RequestParam(value = "memberId", required = false, defaultValue = "0") String memberId, @RequestParam(value = "memberId", required = false, defaultValue = "0") String memberId,
@RequestParam(value = "memberName", required = false, defaultValue = "0") String memberName, @RequestParam(value = "memberName", required = false, defaultValue = "0") String memberName,
@RequestParam(value = "memberStatus", required = false, defaultValue = "0") String memberStatus, @RequestParam(value = "memberStatus", required = false, defaultValue = "0") String memberStatus,
@RequestParam(value = "curDate", required = false, defaultValue = "0") String curDate,
@RequestParam(value = "pageNum", required = false, defaultValue = "1") int pageNum, @RequestParam(value = "pageNum", required = false, defaultValue = "1") int pageNum,
@RequestParam(value = "pageCount", required = false, defaultValue = "4") int pageCount @RequestParam(value = "pageCount", required = false, defaultValue = "4") int pageCount
) { ) {
return keyService.Rockwell_keyServiceGetV_activity_info(tag, title, memberId, memberName, memberStatus, pageNum, pageCount); return keyService.Rockwell_keyServiceGetV_activity_info(tag, title, memberId, memberName, memberStatus, curDate, pageNum, pageCount);
} }
// 3.2 获取 view_activity_detail 的数据 by activityId // 3.2 获取 view_activity_detail 的数据 by activityId
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
...@@ -242,6 +242,10 @@ limitations under the License. ...@@ -242,6 +242,10 @@ limitations under the License.
<if test="title != null and title != '' "> <if test="title != null and title != '' ">
AND ( tag LIKE CONCAT('%', #{title} ,'%') OR title LIKE CONCAT('%', #{title} ,'%') OR member_name LIKE CONCAT('%', #{title} ,'%') ) AND ( tag LIKE CONCAT('%', #{title} ,'%') OR title LIKE CONCAT('%', #{title} ,'%') OR member_name LIKE CONCAT('%', #{title} ,'%') )
</if> </if>
<if test="curDate != null and curDate != '' ">
AND #{curDate} &gt;= DATE_FORMAT(start_datetime,'%Y-%m')
AND #{curDate} &lt;= DATE_FORMAT(end_datetime,'%Y-%m')
</if>
<if test="pagination != null "> <if test="pagination != null ">
<include refid="pagination"/> <include refid="pagination"/>
</if> </if>
...@@ -307,8 +311,11 @@ limitations under the License. ...@@ -307,8 +311,11 @@ limitations under the License.
<if test="userId != null and userId != '' "> <if test="userId != null and userId != '' ">
AND user_id=#{userId} AND user_id=#{userId}
</if> </if>
<if test="orderStatus != null and orderStatus != '' "> <if test="ids != null and ids.size > 0">
AND order_status=#{orderStatus} AND order_status IN
<foreach item="item" index="index" collection="ids" open="(" separator="," close=")">
#{item}
</foreach>
</if> </if>
<if test="pagination != null "> <if test="pagination != null ">
<include refid="pagination"/> <include refid="pagination"/>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论