Commit aa91d073 by jscat

nyx javaapp 功能更新

1. 添加用activityId获取view_activity_info的功能及接口
parent 5075d32a
package cn.com.fun.nyxkey.api.repository;
package cn.com.fun.nyxkey.api.repository;
......@@ -35,6 +35,7 @@ public interface Rockwell_keyMapper {
/* 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_id(Rockwell_keyT_activityQuery rockwell_keyT_activityQuery);
/* post api */
......
package cn.com.fun.nyxkey.api.service;
package cn.com.fun.nyxkey.api.service;
......@@ -45,6 +45,8 @@ public interface Rockwell_keyService {
String memberId, String memberName, String memberStatus,
int pageNum, int pageCount);
JSONResult Rockwell_keyServiceGetV_activity_info_by_id(String activityId);
/* post api */
JSONResult Rockwell_keyServiceGetV_post_info(String tag, String title, String top, int pageNum, int pageCount);
/* todo 添加新增pos功能
......
package cn.com.fun.nyxkey.api.service.impl;
package cn.com.fun.nyxkey.api.service.impl;
......@@ -289,6 +289,31 @@ public class Rockwell_keyServiceImpl implements Rockwell_keyService {
return jsonResult;
}
/* activity api
* 通过 activityId 来获取 view_activity_info 的详细信息
*
* */
public JSONResult Rockwell_keyServiceGetV_activity_info_by_id(String activityId)
{
LOGGER.debug("find Rockwell_keyServiceGetV_activity_info_by_id");
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(activityId) || activityId.equals("0"))
{
return new JSONResult(ExceptionMsg.ParamError);
}
rockwell_keyT_activityQuery.setActivityId(activityId);
listRockwell_keyV_activity_info = rockwell_keyMapper.getV_activity_info_by_id(rockwell_keyT_activityQuery);
int totalCount = listRockwell_keyV_activity_info.size();
JSONResult jsonResult = new JSONResult(totalCount, listRockwell_keyV_activity_info);
return jsonResult;
}
/* post api */
// getV_post_info
public JSONResult Rockwell_keyServiceGetV_post_info(String tag, String title, String top, int pageNum, int pageCount)
......
package cn.com.fun.nyxkey.api.web.controller;
package cn.com.fun.nyxkey.api.web.controller;
......@@ -242,7 +242,7 @@ public class NyxApiController {
}
// APi3 tbl_activity接口 jscat 20200804
// 3.1 获取 view_activity_info的数据 by page, not by activityId
// 3.1 获取 view_activity_info 的数据 by page, not by activityId
@ApiOperation(value="获取商家的activity info", notes="获取商家的activity info")
@ApiImplicitParams({
@ApiImplicitParam(name = "tag", value = "按标签查找; 饮事", required = false, dataType = "String"),
......@@ -266,6 +266,18 @@ public class NyxApiController {
return keyService.Rockwell_keyServiceGetV_activity_info(tag, title, memberId, memberName, memberStatus, pageNum, pageCount);
}
// 3.2 获取 view_activity_info 的数据 by activityId
@ApiOperation(value="获取商家的activity info by activityId", notes="获取商家的activity info by activityId")
@ApiImplicitParams({
@ApiImplicitParam(name = "activityId", value = "按活动id查找", required = true, dataType = "String")
})
@RequestMapping(value = "/nyx/activity/query/id", method = RequestMethod.GET)
public JSONResult RockwellQueryActivityById(
@RequestParam(value = "activityId", required = true, defaultValue = "0") String activityId
) {
return keyService.Rockwell_keyServiceGetV_activity_info_by_id(activityId);
}
// 4.0 post info api
@ApiOperation(value="获取用户的post info", notes="获取用户的post info")
@ApiImplicitParams({
......
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
......@@ -214,7 +214,7 @@ limitations under the License.
</if>
</select>
<!-- activity api 2-1 获取 v_activity_info 的值 update jscat 20200804 -->
<!-- activity api 2-1 获取 v_activity_info 的值 by page update jscat 20200804 -->
<select id="getV_activity_info_by_page" 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
......@@ -229,7 +229,7 @@ limitations under the License.
AND member_name=#{memberName}
</if>
<if test="tag != null and tag != '' ">
AND tag=#{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} ,'%') )
......@@ -239,6 +239,16 @@ limitations under the License.
</if>
</select>
<!-- activity api 2-2 获取 v_activity_info 的值 by id update jscat 20200805 -->
<select id="getV_activity_info_by_id" 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="activityId != null and activityId != '' ">
AND activity_id=#{activityId}
</if>
</select>
<!-- 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">
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论