Commit d8734afa by jscat

nyx javaapp: 功能更新

1. 为 activity 查询功能添加order by 条件
- like: order by num_like desc
- price: order by unit_price asc
- nearest: order by start_datetime asc
parent 6b3ce4ed
package cn.com.fun.nyxkey.api.domain; package cn.com.fun.nyxkey.api.domain;
...@@ -19,7 +19,7 @@ public class Rockwell_keyT_activity{ ...@@ -19,7 +19,7 @@ public class Rockwell_keyT_activity{
private String memberId; // 商家的id, uuid format private String memberId; // 商家的id, uuid format
private String tag; // 活动的标签 private String tag; // 活动的标签
private String title; // 活动的标题 private String title; // 活动的标题
private String numLike; // 针对每条activity的点赞次数,每点一次,则累加 private int numLike; // 针对每条activity的点赞次数,每点一次,则累加
private String content; // 活动内容 private String content; // 活动内容
private String noteImage; // 该条活动的image列表 private String noteImage; // 该条活动的image列表
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
......
package cn.com.fun.nyxkey.api.domain.query; package cn.com.fun.nyxkey.api.domain.query;
...@@ -23,6 +23,8 @@ public class Rockwell_keyT_activityQuery { ...@@ -23,6 +23,8 @@ public class Rockwell_keyT_activityQuery {
private String city; // 城市名称 private String city; // 城市名称
private String memberStatus; // 商家状态, 00: 未注册用户; 01: 已注册用户 private String memberStatus; // 商家状态, 00: 未注册用户; 01: 已注册用户
private String orderType; // 排序类型; orderType='like 最热|nearest 最近(default) |latest 最新'
private String tag; // 发布的标签,比如: 酒单;;活动;;心情;;饮事;;最热Gluh Wein private String tag; // 发布的标签,比如: 酒单;;活动;;心情;;饮事;;最热Gluh Wein
private String title; // 发布标题,比如:此生必去系列。 private String title; // 发布标题,比如:此生必去系列。
...@@ -98,6 +100,18 @@ public class Rockwell_keyT_activityQuery { ...@@ -98,6 +100,18 @@ public class Rockwell_keyT_activityQuery {
} }
} }
public void setOrderType(String strOrderType)
{
if(strOrderType.equals("0"))
{
this.orderType = null;
}
else
{
this.orderType = strOrderType;
}
}
public void setTag(String strTag) public void setTag(String strTag)
{ {
if(strTag.equals("0")) if(strTag.equals("0"))
...@@ -168,6 +182,7 @@ public class Rockwell_keyT_activityQuery { ...@@ -168,6 +182,7 @@ public class Rockwell_keyT_activityQuery {
"memberName='" + memberName + '\'' + "memberName='" + memberName + '\'' +
"city='" + city + '\'' + "city='" + city + '\'' +
"memberStatus='" + memberStatus + '\'' + "memberStatus='" + memberStatus + '\'' +
"orderType='" + orderType + '\'' +
"tag='" + tag + '\'' + "tag='" + tag + '\'' +
"title='" + title + '\'' + "title='" + title + '\'' +
"curDate='" + curDate + '\'' + "curDate='" + curDate + '\'' +
......
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 curDate, String memberId, String memberName, String memberStatus, String orderType, 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, 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); String beginDate, String endDate, int pageNum, int pageCount);
...@@ -67,7 +67,6 @@ public interface Rockwell_keyService { ...@@ -67,7 +67,6 @@ public interface Rockwell_keyService {
int pageNum, int pageCount); int pageNum, int pageCount);
JSONResult Rockwell_keyServiceGetV_order_detail(String userId, String orderStatus, int pageNum, int pageCount); JSONResult Rockwell_keyServiceGetV_order_detail(String userId, String orderStatus, int pageNum, int pageCount);
// testing // testing
void Rockwell_keyServiceTest(List<Rockwell_keyT_match> listRockwell_keyT_match); 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;
...@@ -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 curDate, String memberId, String memberName, String memberStatus, String orderType, String curDate,
int pageNum, int pageCount) int pageNum, int pageCount)
{ {
LOGGER.debug("find Rockwell_keyServiceGetV_activity_info"); LOGGER.debug("find Rockwell_keyServiceGetV_activity_info");
...@@ -323,6 +323,7 @@ public class Rockwell_keyServiceImpl implements Rockwell_keyService { ...@@ -323,6 +323,7 @@ public class Rockwell_keyServiceImpl implements Rockwell_keyService {
} }
rockwell_keyT_activityQuery.setMemberId(memberId); rockwell_keyT_activityQuery.setMemberId(memberId);
rockwell_keyT_activityQuery.setMemberName(memberName); rockwell_keyT_activityQuery.setMemberName(memberName);
rockwell_keyT_activityQuery.setOrderType(orderType);
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.setCurDate(curDate);
...@@ -505,8 +506,6 @@ public class Rockwell_keyServiceImpl implements Rockwell_keyService { ...@@ -505,8 +506,6 @@ public class Rockwell_keyServiceImpl implements Rockwell_keyService {
} }
// testing // testing
public void Rockwell_keyServiceTest(List<Rockwell_keyT_match> listRockwell_keyT_match) 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;
...@@ -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 = "orderType", value = "按排序条件查找", required = false, dataType = "String"),
@ApiImplicitParam(name = "curDate", 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")
...@@ -280,11 +281,12 @@ public class NyxApiController { ...@@ -280,11 +281,12 @@ 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 = "orderType", required = false, defaultValue = "0") String orderType,
@RequestParam(value = "curDate", required = false, defaultValue = "0") String curDate, @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, curDate, pageNum, pageCount); return keyService.Rockwell_keyServiceGetV_activity_info(tag, title, memberId, memberName, memberStatus, orderType, curDate, pageNum, pageCount);
} }
// 3.2 获取 view_activity_detail 的数据 by activityId // 3.2 获取 view_activity_detail 的数据 by activityId
...@@ -413,9 +415,6 @@ public class NyxApiController { ...@@ -413,9 +415,6 @@ public class NyxApiController {
return keyService.Rockwell_keyServiceGetV_order_info(memberId, userId, activityId, orderStatus, pageNum, pageCount); return keyService.Rockwell_keyServiceGetV_order_info(memberId, userId, activityId, orderStatus, pageNum, pageCount);
} }
// 2.0 test // 2.0 test
@ApiOperation(value="test", notes="test") @ApiOperation(value="test", notes="test")
@ApiImplicitParams({ @ApiImplicitParams({
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
...@@ -227,6 +227,7 @@ limitations under the License. ...@@ -227,6 +227,7 @@ limitations under the License.
resultType="cn.com.fun.nyxkey.api.domain.Rockwell_keyV_activity_info"> resultType="cn.com.fun.nyxkey.api.domain.Rockwell_keyV_activity_info">
select * from view_activity_info select * from view_activity_info
where 1=1 where 1=1
AND DATE_FORMAT(NOW(),'%Y-%m-%d') &lt;= DATE_FORMAT(end_datetime,'%Y-%m-%d')
<if test="memberId != null and memberId != '' "> <if test="memberId != null and memberId != '' ">
AND member_id=#{memberId} AND member_id=#{memberId}
</if> </if>
...@@ -236,9 +237,6 @@ limitations under the License. ...@@ -236,9 +237,6 @@ limitations under the License.
<if test="memberName != null and memberName != '' "> <if test="memberName != null and memberName != '' ">
AND member_name=#{memberName} AND member_name=#{memberName}
</if> </if>
<if test="tag != null and tag != '' ">
AND tag LIKE CONCAT('%', #{tag} ,'%')
</if>
<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>
...@@ -246,6 +244,17 @@ limitations under the License. ...@@ -246,6 +244,17 @@ limitations under the License.
AND #{curDate} &gt;= DATE_FORMAT(start_datetime,'%Y-%m') AND #{curDate} &gt;= DATE_FORMAT(start_datetime,'%Y-%m')
AND #{curDate} &lt;= DATE_FORMAT(end_datetime,'%Y-%m') AND #{curDate} &lt;= DATE_FORMAT(end_datetime,'%Y-%m')
</if> </if>
<choose>
<when test="orderType != null and orderType != '' and orderType =='like' ">
order by num_like desc
</when>
<when test="orderType != null and orderType != '' and orderType =='price' ">
order by unit_price asc
</when>
<otherwise>
order by start_datetime asc
</otherwise>
</choose>
<if test="pagination != null "> <if test="pagination != null ">
<include refid="pagination"/> <include refid="pagination"/>
</if> </if>
...@@ -381,6 +390,5 @@ limitations under the License. ...@@ -381,6 +390,5 @@ limitations under the License.
</if> </if>
</select> </select>
<!-- ending API interface --> <!-- ending API interface -->
</mapper> </mapper>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论