Commit 394a6621 by jscat

nyx-app: 更新java后台功能

1. 添加tbl_match_bonus和view_match_bonus, view_match_point数据结构
2. 添加更新tbl_match和tbl_match_bonus的功能
parent 9827513c
package cn.com.fun.nyxkey.api.domain;
package cn.com.fun.nyxkey.api.domain;
......@@ -8,7 +8,7 @@ import java.util.Date;
/**
* 竞答结果 tbl_match
* Created by jscat on 2020/01/06.
* Created by jscat on 2020/07/31.
*/
@Data
@AllArgsConstructor
......@@ -16,15 +16,11 @@ import java.util.Date;
public class Rockwell_keyT_match{
private String matchId; // 竞答的id uuid format
private String matchSeason; // 竞答赛季, s01
private String matchType; // 竞答类别: daily|pk
private String matchTeam; // 竞答队伍 uid_001
private String teamType; //主队还是客队 blue|red
private String matchResult; // 竞答结果 win|lose;
private String matchScore; // 竞答分数, 比如:;uid_1:1;uid_2:0;
private String quizIndex; // '竞答|学习进行到第几题',
private String rankScore; // 段位分数, 胜利+2,失败-1
private String memberId; // 商家的id uuid format
private String userId; // 用户的id uuid format
private String matchStatus; // (可用|不可用): 1|
private Double matchPoint; // 得分: 4.5 or 5.0
private String matchResult; // 结果: 9/10
@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")
......
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;
/**
* 竞答结果 tbl_match_bonus
* Created by jscat on 2020/07/31.
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Rockwell_keyT_match_bonus{
private String matchId; // 竞答的id uuid format
private String userId; // 用户的id uuid format
private String userName; // 用户名
private Double bonusPoint; // 得分: 0.5
@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;
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/07/31.
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Rockwell_keyV_match_point{
private String matchId; // 竞答的id uuid format
private String matchStatus; // (可用|不可用): 1|
private String memberId; // 商家的id uuid format
private String memberName; // 商家的名称
private String userId; // 用户的id uuid format
private String nickName; // 用户的名称
private String matchPoint; // 竞答得分: 4.5 or 5.0
private String bonusPoint; // 助力得分: 4.5 or 5.0
private String totalPoint; // 总得分: 4.5 or 5.0
private String bonusCount; // 助力人次: 4
}
package cn.com.fun.nyxkey.api.domain.query;
package cn.com.fun.nyxkey.api.domain.query;
......@@ -20,82 +20,78 @@ public class Rockwell_keyT_matchQuery {
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date createDatetime;
private String matchId;
private String matchSeason;
private String matchType;
private String matchTeam; //userid
private String matchResult; //用于统计比赛胜负 win|lose
private String memberId;
private String userId;
private String matchStatus; // 积分状态, 可用|不可用
private Pagination pagination;
private List<Rockwell_keyT_match> listRockwell_keyT_match;
private List<Rockwell_keyV_match_rank> listRockwell_keyV_match_rank;
//默认返回1页4条记录
public Rockwell_keyT_matchQuery()
{
this.pagination = new Pagination(1, 4);
}
public void setMatchSeason(String strMatchSeason)
public void setMatchStatus(String strMatchStatus)
{
if(strMatchSeason.equals("0"))
if(strMatchStatus.equals("0"))
{
this.matchSeason = null;
this.matchStatus = null;
}
else
{
this.matchSeason = strMatchSeason;
this.matchStatus = strMatchStatus;
}
}
public void setMatchType(String strMatchType)
public void setMemberId(String strMemberId)
{
if(strMatchType.equals("0"))
if(strMemberId.equals("0"))
{
this.matchType = null;
this.memberId = null;
}
else
{
this.matchType = strMatchType;
this.memberId = strMemberId;
}
}
public void setMatchId(String strMatchId)
public void setUserId(String strUserId)
{
if(strMatchId.equals("0"))
if(strUserId.equals("0"))
{
this.matchId = null;
this.userId = null;
}
else
{
this.matchId = strMatchId;
this.userId = strUserId;
}
}
}
public void setMatchTeam(String strMatchTeam)
public void setMatchId(String strMatchId)
{
if(strMatchTeam.equals("0"))
if(strMatchId.equals("0"))
{
this.matchTeam = null;
this.matchId = null;
}
else
{
this.matchTeam = strMatchTeam;
this.matchId = strMatchId;
}
}
@Override
public String toString() {
return "Rockwell_keyT_matchQuery{" +
"createDatetime='" + createDatetime + '\'' +
"matchId='" + matchId + '\'' +
"matchSeason='" + matchSeason + '\'' +
"matchType='" + matchType + '\'' +
"matchTeam='" + matchTeam + '\'' +
"matchResult='" + matchResult + '\'' +
"matchStatus='" + matchStatus + '\'' +
"memberId='" + memberId + '\'' +
"userId='" + userId + '\'' +
"pagination='" + pagination + '\'' +
"listRockwell_keyT_match='" + listRockwell_keyT_match + '\'' +
"listRockwell_keyV_match_rank='" + listRockwell_keyV_match_rank + '\'' +
'}';
}
}
package cn.com.fun.nyxkey.api.etl;
package cn.com.fun.nyxkey.api.etl;
......@@ -24,25 +24,25 @@ public class DataProcessor {
private Rockwell_keyService rockwell_keyService;
//计算赛季
public String getSeason()
{
Calendar calender = Calendar.getInstance();
Date date = new Date();
calender.setTime(date);
Integer year = calender.get(Calendar.YEAR);
Integer month = calender.get(Calendar.MONTH);
Integer season = year % 2020 * 4 + month/3 + 1;
String matchSeason = season >= 10 ? String.valueOf(season) : '0' + String.valueOf(season);
return "s"+String.valueOf(matchSeason);
}
@Scheduled(cron = "${app.service.cron.genT_match_rank}")
public void runStat() {
String matchSeason = getSeason();
rockwell_keyService.Rockwell_keyServiceGenT_match_rank(matchSeason);
}
// public String getSeason()
// {
// Calendar calender = Calendar.getInstance();
// Date date = new Date();
// calender.setTime(date);
// Integer year = calender.get(Calendar.YEAR);
// Integer month = calender.get(Calendar.MONTH);
//
//
// Integer season = year % 2020 * 4 + month/3 + 1;
// String matchSeason = season >= 10 ? String.valueOf(season) : '0' + String.valueOf(season);
// return "s"+String.valueOf(matchSeason);
// }
// @Scheduled(cron = "${app.service.cron.genT_match_rank}")
// public void runStat() {
//
// String matchSeason = getSeason();
// rockwell_keyService.Rockwell_keyServiceGenT_match_rank(matchSeason);
// }
}
package cn.com.fun.nyxkey.api.repository;
package cn.com.fun.nyxkey.api.repository;
......@@ -23,16 +23,20 @@ public interface Rockwell_keyMapper {
List<Rockwell_keyV_quiz_type_total> getT_quiz_type_total(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
void addT_quizDefectItem(Rockwell_keyT_quiz_defect rockwell_keyT_quiz_defect);
/* 通过pagination, matchId查询t_match */
/* 通过pagination, matchId 查询t_match */
List<Rockwell_keyT_match> getT_match_by_matchid(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
List<Rockwell_keyT_match> getV_match_point_by_matchid(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
List<Rockwell_keyT_match> getT_match_by_page(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
void addT_matchList(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
void addT_matchItem(Rockwell_keyT_match rockwell_keyT_match);
// 更新match_status的状态 主要是由可用->不可用 jscat 20200731
void updateT_match_status(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
void addT_match_bonusItem(Rockwell_keyT_match_bonus rockwell_keyT_match_bonus);
/* match rank api */
List<Rockwell_keyV_match_rank> getV_match_rank(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
void updateT_match_rank_defaultType(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
void genT_match_rank(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
// List<Rockwell_keyV_match_rank> getV_match_rank(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
// void updateT_match_rank_defaultType(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
// void genT_match_rank(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
/* post api */
List<Rockwell_keyV_post_info> getV_post_info(Rockwell_keyT_postQuery rockwell_keyT_postQuery);
......@@ -40,8 +44,8 @@ public interface Rockwell_keyMapper {
void addT_postLike(Rockwell_keyT_post rockwell_keyT_post);
/* pair api */
List<Rockwell_keyT_pair> getT_pair(Rockwell_keyT_pairQuery rockwell_keyT_pairQuery);
void addT_pair(Rockwell_keyT_pair rockwell_keyT_pair);
// List<Rockwell_keyT_pair> getT_pair(Rockwell_keyT_pairQuery rockwell_keyT_pairQuery);
// void addT_pair(Rockwell_keyT_pair rockwell_keyT_pair);
/* area api */
List<Rockwell_keyV_area_total> getCityList();
......
package cn.com.fun.nyxkey.api.service;
package cn.com.fun.nyxkey.api.service;
......@@ -20,27 +20,18 @@ public interface Rockwell_keyService {
JSONResult Rockwell_keyServiceGetT_quizRand();
JSONResult Rockwell_keyServiceGetT_matchLike();
JSONResult Rockwell_keyServiceGetT_quizitem(String questionId);
JSONResult Rockwell_keyServiceGetT_quiz_study(String matchSeason, String matchType, String matchTeam, String quizId, int pageNum, int pageCount);
int addT_quizDefectItem(String questionId, String userId, String userComment);
JSONResult Rockwell_keyServiceGetT_quiz_type_total(String matchType);
// t_match相关service
// getT_match三个场合
// 1. match详情,指定matchId
// 2. 查询比赛历史 with pagination, 指定matchTeam, order by create_datetime desc, match_status == 1
// 3. 今日比赛未完,依靠create_datetime & match_status
JSONResult Rockwell_keyServiceGetT_match_by_matchid(String matchId);
JSONResult Rockwell_keyServiceGetT_match_by_page(String matchSeason, String matchType, String matchTeam);
JSONResult Rockwell_keyServiceGetT_match_by_page(String memberId, String userId, String matchStatus);
void Rockwell_keyServiceAddT_matchList(List<Rockwell_keyT_match> listRockwell_keyT_match);
void Rockwell_keyServiceAddT_matchItem(String matchSeason, String matchType, String matchTeam, String matchScore,
String teamType, String matchResult, String quizIndex, String rankScore);
// match ranking
JSONResult Rockwell_keyServiceGetV_match_rank(String matchSeason, String matchType, String matchTeam);
void Rockwell_keyServiceUpdateT_match_rank_defaultType(List<Rockwell_keyV_match_rank> listRockwell_keyV_match_rank);
void Rockwell_keyServiceGenT_match_rank(String matchSeason);
void Rockwell_keyServiceAddT_matchItem(String memberId, String userId, Double matchPoint, String matchResult);
int Rockwell_keyServiceUpdateT_match_status(String matchId);
void Rockwell_keyServiceAddT_match_bonusItem(String matchId, String userId, String userName, Double bonusPoint);
/* post api */
JSONResult Rockwell_keyServiceGetV_post_info(String tag, String title, String top, int pageNum, int pageCount);
......@@ -50,15 +41,6 @@ public interface Rockwell_keyService {
int Rockwell_keyServiceAddT_post(String userId, String noteImage, String tag, String title, String content) throws UnsupportedEncodingException;
int Rockwell_keyServiceAddT_postLike(String postId);
/* pair api 20200530 jscat */
JSONResult Rockwell_keyServiceGetT_pair(String userId, String strSearchName, int pageNum, int pageCount);
int Rockwell_keyServiceAddT_pair(String userId, String food, String wineName, String wineDesc,
String imgLink, String wineLink, String sourceLink) throws UnsupportedEncodingException;
/* 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;
......@@ -106,47 +106,6 @@ public class Rockwell_keyServiceImpl implements Rockwell_keyService {
return jsonResult;
}
public JSONResult Rockwell_keyServiceGetT_quiz_study(String matchSeason, String matchType, String matchTeam, String quizId, int pageNum, int pageCount)
{
LOGGER.debug("find Rockwell_keyServiceGetT_quiz_by_study");
List<Rockwell_keyT_quiz> listRockwell_keyT_quiz = new ArrayList<Rockwell_keyT_quiz>();
Rockwell_keyT_matchQuery rockwell_keyT_matchQuery = new Rockwell_keyT_matchQuery();
rockwell_keyT_matchQuery.setMatchSeason(matchSeason);
rockwell_keyT_matchQuery.setMatchType(matchType);
rockwell_keyT_matchQuery.setMatchTeam(matchTeam);
rockwell_keyT_matchQuery.setMatchId(quizId);
rockwell_keyT_matchQuery.setPagination(new Pagination(pageNum,pageCount));
if(!quizId.equals("0") && quizId != null)
{
listRockwell_keyT_quiz = rockwell_keyMapper.getT_quiz_study_by_id(rockwell_keyT_matchQuery);
}
else
{
listRockwell_keyT_quiz = rockwell_keyMapper.getT_quiz_study_by_sql(rockwell_keyT_matchQuery);
}
int totalCount = listRockwell_keyT_quiz.size();
JSONResult jsonResult = new JSONResult(totalCount, listRockwell_keyT_quiz);
return jsonResult;
}
public JSONResult Rockwell_keyServiceGetT_quiz_type_total(String matchType)
{
LOGGER.debug("find Rockwell_keyServiceGetT_quiz_type_total");
List<Rockwell_keyV_quiz_type_total> listRockwell_keyV_quiz_type_total = new ArrayList<Rockwell_keyV_quiz_type_total>();
Rockwell_keyT_matchQuery rockwell_keyT_matchQuery = new Rockwell_keyT_matchQuery();
rockwell_keyT_matchQuery.setMatchType(matchType);
listRockwell_keyV_quiz_type_total = rockwell_keyMapper.getT_quiz_type_total(rockwell_keyT_matchQuery);
int totalCount = listRockwell_keyV_quiz_type_total.size();
JSONResult jsonResult = new JSONResult(totalCount, listRockwell_keyV_quiz_type_total);
return jsonResult;
}
/*
接口api: 获取竞答的点赞数
*/
......@@ -182,7 +141,6 @@ public class Rockwell_keyServiceImpl implements Rockwell_keyService {
// getT_match三个场合
// 1. match详情,指定matchId
// 2. 查询比赛历史 with pagination, 指定matchTeam, order by create_datetime desc, match_status == 1
// 3. 今日比赛结果daily,依靠create_datetime & match_status
public JSONResult Rockwell_keyServiceGetT_match_by_matchid(String matchId){
LOGGER.debug("find Rockwell_keyServiceGetT_match_by_matchid");
......@@ -196,14 +154,15 @@ public class Rockwell_keyServiceImpl implements Rockwell_keyService {
}
public JSONResult Rockwell_keyServiceGetT_match_by_page(String matchSeason, String matchType, String matchTeam){
LOGGER.debug("find Rockwell_keyServiceGetT_match_by_matchstatus");
public JSONResult Rockwell_keyServiceGetT_match_by_page(String memberId, String userId, String matchStatus)
{
LOGGER.debug("find Rockwell_keyServiceGetT_match_by_page");
List<Rockwell_keyT_match> listRockwell_keyT_match = new ArrayList<Rockwell_keyT_match>();
Rockwell_keyT_matchQuery rockwell_keyT_matchQuery = new Rockwell_keyT_matchQuery();
rockwell_keyT_matchQuery.setMatchSeason(matchSeason);
rockwell_keyT_matchQuery.setMatchType(matchType);
rockwell_keyT_matchQuery.setMatchTeam(matchTeam);
rockwell_keyT_matchQuery.setMemberId(memberId);
rockwell_keyT_matchQuery.setUserId(userId);
rockwell_keyT_matchQuery.setMatchStatus(matchStatus);
listRockwell_keyT_match = rockwell_keyMapper.getT_match_by_page(rockwell_keyT_matchQuery);
int totalCount = listRockwell_keyT_match.size();
JSONResult jsonResult = new JSONResult(totalCount, listRockwell_keyT_match);
......@@ -218,63 +177,46 @@ public class Rockwell_keyServiceImpl implements Rockwell_keyService {
rockwell_keyMapper.addT_matchList(rockwell_keyT_matchQuery);
}
public void Rockwell_keyServiceAddT_matchItem(String matchSeason, String matchType, String matchTeam, String matchScore,
String teamType, String matchResult, String quizIndex, String rankScore)
public void Rockwell_keyServiceAddT_matchItem(String memberId, String userId, Double matchPoint, String matchResult)
{
LOGGER.debug("find Rockwell_keyServiceAddT_matchItem");
Rockwell_keyT_match rockwell_keyT_match = new Rockwell_keyT_match();
rockwell_keyT_match.setMatchId("mid_"+UUID.randomUUID().toString());
rockwell_keyT_match.setMatchSeason(matchSeason);
rockwell_keyT_match.setMatchType(matchType);
rockwell_keyT_match.setMatchTeam(matchTeam);
rockwell_keyT_match.setMatchScore(matchScore);
rockwell_keyT_match.setTeamType(teamType);
rockwell_keyT_match.setMatchStatus("1");
rockwell_keyT_match.setMemberId(memberId);
rockwell_keyT_match.setUserId(userId);
rockwell_keyT_match.setMatchPoint(matchPoint);
rockwell_keyT_match.setMatchResult(matchResult);
rockwell_keyT_match.setQuizIndex(quizIndex);
rockwell_keyT_match.setRankScore(rankScore);
rockwell_keyT_match.setCreateDatetime(new Date());
rockwell_keyT_match.setUpdateDatetime(new Date());
rockwell_keyMapper.addT_matchItem(rockwell_keyT_match);
}
// 获取match_season, match_type, match_team, score, rank, total的值
// 用于我的排名 jscat 2020-02-21
public JSONResult Rockwell_keyServiceGetV_match_rank(String matchSeason, String matchType, String matchTeam)
/*
* 更新tbl_match的match_status
* */
public int Rockwell_keyServiceUpdateT_match_status(String matchId)
{
LOGGER.debug("find Rockwell_keyServiceUpdateT_match_status");
Rockwell_keyT_matchQuery rockwell_keyT_matchQuery = new Rockwell_keyT_matchQuery();
rockwell_keyT_matchQuery.setMatchSeason(matchSeason);
rockwell_keyT_matchQuery.setMatchTeam(matchTeam);
rockwell_keyT_matchQuery.setMatchType(matchType);
//20200306 jscat 实时更新排名,会不会很慢?
rockwell_keyMapper.genT_match_rank(rockwell_keyT_matchQuery);
List<Rockwell_keyV_match_rank> listRockwell_keyV_match_rank= new ArrayList<Rockwell_keyV_match_rank>();
listRockwell_keyV_match_rank = rockwell_keyMapper.getV_match_rank(rockwell_keyT_matchQuery);
int totalCount = listRockwell_keyV_match_rank.size();
JSONResult jsonResult = new JSONResult(totalCount, listRockwell_keyV_match_rank);
return jsonResult;
rockwell_keyT_matchQuery.setMatchId(matchId);
rockwell_keyMapper.updateT_match_status(rockwell_keyT_matchQuery);
return 0;
}
// 获取match_season, match_type, match_team, score, rank, total的值
// 用于我的排名 jscat 2020-02-21
public void Rockwell_keyServiceUpdateT_match_rank_defaultType(List<Rockwell_keyV_match_rank> listRockwell_keyV_match_rank)
public void Rockwell_keyServiceAddT_match_bonusItem(String matchId, String userId, String userName, Double bonusPoint)
{
Rockwell_keyT_matchQuery rockwell_keyT_matchQuery = new Rockwell_keyT_matchQuery();
rockwell_keyT_matchQuery.setListRockwell_keyV_match_rank(listRockwell_keyV_match_rank);
rockwell_keyMapper.updateT_match_rank_defaultType(rockwell_keyT_matchQuery);
LOGGER.debug("find Rockwell_keyServiceAddT_match_bonusItem");
Rockwell_keyT_match_bonus rockwell_keyT_match_bonus = new Rockwell_keyT_match_bonus();
rockwell_keyT_match_bonus.setMatchId(matchId);
rockwell_keyT_match_bonus.setUserId(userId);
rockwell_keyT_match_bonus.setUserName(userName);
rockwell_keyT_match_bonus.setBonusPoint(bonusPoint);
rockwell_keyT_match_bonus.setCreateDatetime(new Date());
rockwell_keyT_match_bonus.setUpdateDatetime(new Date());
rockwell_keyMapper.addT_match_bonusItem(rockwell_keyT_match_bonus);
}
// 生成t_match_rank
// 用于我的排名 jscat 2020-02-21
public void Rockwell_keyServiceGenT_match_rank(String matchSeason)
{
Rockwell_keyT_matchQuery rockwell_keyT_matchQuery = new Rockwell_keyT_matchQuery();
rockwell_keyT_matchQuery.setMatchSeason(matchSeason);
rockwell_keyMapper.genT_match_rank(rockwell_keyT_matchQuery);
}
/* post api */
// getV_post_info
......@@ -332,92 +274,6 @@ public class Rockwell_keyServiceImpl implements Rockwell_keyService {
return 0;
}
/*
pair service pair-1.1
获取 pair
*/
public JSONResult Rockwell_keyServiceGetT_pair(String userId, String strSearchName, int pageNum, int pageCount){
Rockwell_keyT_pairQuery rockwell_keyT_pairQuery = new Rockwell_keyT_pairQuery();
rockwell_keyT_pairQuery.setUserId(userId);
List<String> listSearchName = new ArrayList<String>();
if(!(strSearchName.equals("") || strSearchName.equals("0")))
{
listSearchName = Arrays.asList(strSearchName.replaceAll(" +", " ").split(" "));
System.out.println("sql string: "+listSearchName.toString());
LOGGER.debug("============= sql string: "+listSearchName.toString());
rockwell_keyT_pairQuery.setListStrSearchName(listSearchName);
}
rockwell_keyT_pairQuery.setPagination(new Pagination(pageNum, pageCount));
List<Rockwell_keyT_pair> listRockwell_keyT_pair = new ArrayList<Rockwell_keyT_pair>();
listRockwell_keyT_pair = rockwell_keyMapper.getT_pair(rockwell_keyT_pairQuery);
int totalCount = listRockwell_keyT_pair.size();
JSONResult jsonResult = new JSONResult(totalCount, listRockwell_keyT_pair);
return jsonResult;
}
/*
pair service pair-1.2
添加 pair
*/
public int Rockwell_keyServiceAddT_pair(String userId, String food, String wineName, String wineDesc,
String imgLink, String wineLink, String sourceLink) throws UnsupportedEncodingException
{
LOGGER.debug("find Rockwell_keyServiceAddT_pair");
System.out.println("find Rockwell_keyServiceAddT_pair");
Rockwell_keyT_pair rockwell_keyT_pair = new Rockwell_keyT_pair();
rockwell_keyT_pair.setPairId("pid_"+UUID.randomUUID().toString());
rockwell_keyT_pair.setUserId(userId);
rockwell_keyT_pair.setFood(food);
rockwell_keyT_pair.setWineName(wineName);
rockwell_keyT_pair.setWineDesc(wineDesc);
rockwell_keyT_pair.setImgLink(imgLink);
rockwell_keyT_pair.setWineLink(wineLink);
rockwell_keyT_pair.setSourceLink(sourceLink);
rockwell_keyT_pair.setCreateDatetime(new Date());
rockwell_keyT_pair.setUpdateDatetime(new Date());
rockwell_keyMapper.addT_pair(rockwell_keyT_pair);
return 0;
}
/* 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;
......@@ -33,7 +33,6 @@ public class IndexController extends BaseController{
@RequestMapping(value="/",method=RequestMethod.GET)
public String index_default(Model model){
// model.addAttribute("collector","");
Rockwell_userT_user user = super.getUser();
if(null != user){
model.addAttribute("user",user);
......
package cn.com.fun.nyxkey.api.web.controller;
package cn.com.fun.nyxkey.api.web.controller;
......@@ -97,42 +97,6 @@ public class NyxApiController {
keyService.addT_quizDefectItem(questionId, userId, userComment);
}
// 1.3 知识学习模式获取具体quiz结果
@ApiOperation(value="知识学习模式获取具体quiz结果", notes="知识学习模式获取具体quiz结果")
@ApiImplicitParams({
@ApiImplicitParam(name = "matchSeason", value = "赛季; s01", required = false, dataType = "String"),
@ApiImplicitParam(name = "matchType", value = "比赛类型: pk|daily|study", required = false, dataType = "String"),
@ApiImplicitParam(name = "matchTeam", value = "竞答队伍: uid_001", required = false, dataType = "String"),
@ApiImplicitParam(name = "quizId", value = "题目序号", required = false, dataType = "String"),
@ApiImplicitParam(name = "pageNum", value = "页码,从1开始", required = false, dataType = "String", defaultValue = "1"),
@ApiImplicitParam(name = "pageCount", value = "每页的数据个数,默认是4个", required = false, dataType = "String", defaultValue = "10")
})
@RequestMapping(value = "/nyx/quiz/query/study", method = RequestMethod.GET)
public JSONResult RockwellGetQuizQueryStudy(
@RequestParam(value = "matchSeason", required = false, defaultValue = "0") String matchSeason,
@RequestParam(value = "matchType", required = false, defaultValue = "0") String matchType,
@RequestParam(value = "matchTeam", required = false, defaultValue = "0") String matchTeam,
@RequestParam(value = "quizId", required = false, defaultValue = "0") String quizId,
@RequestParam(value = "pageNum", required = false, defaultValue = "1") int pageNum,
@RequestParam(value = "pageCount", required = false, defaultValue = "10") int pageCount
) {
LOGGER.debug("======================/nyx/quiz/query/item");
return keyService.Rockwell_keyServiceGetT_quiz_study(matchSeason, matchType, matchTeam, quizId, pageNum, pageCount);
}
// 1.4 获取Quiz某一类matchType的总数目
@ApiOperation(value="获取Quiz某一类matchType的总数目", notes="获取Quiz某一类matchType的总数目")
@ApiImplicitParams({
@ApiImplicitParam(name = "matchType", value = "比赛类型: pk|daily|study", required = false, dataType = "String")
})
@RequestMapping(value = "/nyx/quiz/total/query", method = RequestMethod.GET)
public JSONResult RockwellGetQuizQueryStudy(
@RequestParam(value = "matchType", required = false) String matchType
) {
LOGGER.debug("======================/nyx/quiz/total/query");
return keyService.Rockwell_keyServiceGetT_quiz_type_total(matchType);
}
// APi2 t_match接口
// 2.1 为t_match添加match,对应tbl_match
@ApiOperation(value="为t_match添加match,对应tbl_match", notes="为t_match添加match,对应tbl_match")
......@@ -147,34 +111,35 @@ public class NyxApiController {
keyService.Rockwell_keyServiceAddT_matchList(listRockwell_keyT_match);
}
// APi2 t_match接口
// APi2 t_match接口 jscat 20200731
// 2.2 为t_match添加match,对应tbl_match
/* 积分生成流程:
1) user_id 参与 member_id 竞答
2) 得到 match_point, match_result, 默认match_status为1
3) 生成match_id
4)存储到数据库
积分使用流程:
5)小程序前端基于match_id生成qrcode (pros: 1.不需要存储到oss; 2.小程序前端直接生成)
6)扫一扫识别qrcode,拿到match_id, 然后后台调用updateT_match_status()
7) 完成
*/
@ApiOperation(value="为t_match添加match,对应tbl_match", notes="为t_match添加match,对应tbl_match")
@ApiImplicitParams({
@ApiImplicitParam(name = "matchSeason", value = "赛季; s01", required = false, dataType = "String"),
@ApiImplicitParam(name = "matchType", value = "比赛类型: pk|daily|study", required = false, dataType = "String"),
@ApiImplicitParam(name = "matchTeam", value = "竞答队伍: uid_001", required = false, dataType = "String"),
@ApiImplicitParam(name = "matchScore", value = "竞答中答对的个数", required = false, dataType = "String"),
@ApiImplicitParam(name = "teamType", value = "主队还是客队 blue|red", required = false, dataType = "String"),
@ApiImplicitParam(name = "matchResult", value = "竞答结果", required = false, dataType = "String"),
@ApiImplicitParam(name = "quizIndex", value = "竞答已完成题数|学习进行到第几题", required = false, dataType = "String"),
@ApiImplicitParam(name = "rankScore", value = "竞答得分", required = false, dataType = "String"),
@ApiImplicitParam(name = "memberId", value = "商户的id", required = true, dataType = "String"),
@ApiImplicitParam(name = "userId", value = "用户的id", required = true, dataType = "String"),
@ApiImplicitParam(name = "matchPoint", value = "得分: 4.5 or 5.0", required = true, dataType = "Double"),
@ApiImplicitParam(name = "matchResult", value = "结果: 9/10", required = true, dataType = "String")
})
@RequestMapping(value = "/nyx/match/add/item", method = RequestMethod.POST)
@ResponseBody
public void RockwellAddMatchItem(
@RequestParam(value = "matchSeason", required = false, defaultValue = "0") String matchSeason,
@RequestParam(value = "matchType", required = false, defaultValue = "0") String matchType,
@RequestParam(value = "matchTeam", required = false, defaultValue = "0") String matchTeam,
@RequestParam(value = "matchScore", required = false, defaultValue = "0") String matchScore,
@RequestParam(value = "teamType", required = false, defaultValue = "0") String teamType,
@RequestParam(value = "matchResult", required = false, defaultValue = "0") String matchResult,
@RequestParam(value = "quizIndex", required = false, defaultValue = "0") String quizIndex,
@RequestParam(value = "rankScore", required = false, defaultValue = "0") String rankScore
@RequestParam(value = "memberId", required = false, defaultValue = "0") String memberId,
@RequestParam(value = "userId", required = false, defaultValue = "0") String userId,
@RequestParam(value = "matchPoint", required = false, defaultValue = "0.0") Double matchPoint,
@RequestParam(value = "matchResult", required = false, defaultValue = "0") String matchResult
) {
keyService.Rockwell_keyServiceAddT_matchItem(matchSeason, matchType, matchTeam, matchScore,
teamType, matchResult, quizIndex, rankScore);
keyService.Rockwell_keyServiceAddT_matchItem(memberId, userId, matchPoint, matchResult);
}
// 1.8 get t_match by matchId
......@@ -190,61 +155,6 @@ public class NyxApiController {
return keyService.Rockwell_keyServiceGetT_match_by_matchid(matchId);
}
// 1.9 get t_match daily by matchteam 获取每日推荐竞答结果
@ApiOperation(value="get t_match by page", notes="get t_match by page")
@ApiImplicitParams({
@ApiImplicitParam(name = "matchSeason", value = "赛季; s01", required = false, dataType = "String"),
@ApiImplicitParam(name = "matchType", value = "比赛类型: pk|daily|study", required = false, dataType = "String"),
@ApiImplicitParam(name = "matchTeam", value = "竞答队伍: uid_001", required = false, 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/match/query", method = RequestMethod.GET)
public JSONResult RockwellQueryMatchDaily(
@RequestParam(value = "matchSeason", required = false) String matchSeason,
@RequestParam(value = "matchType", required = false) String matchType,
@RequestParam(value = "matchTeam", required = false) String matchTeam,
@RequestParam(value = "pageNum", required = false, defaultValue = "1") int pageNum,
@RequestParam(value = "pageCount", required = false, defaultValue = "5") int pageCount
) {
return keyService.Rockwell_keyServiceGetT_match_by_page(matchSeason, matchType, matchTeam);
}
// 2.0 match ranking
@ApiOperation(value="获取用户的排名rank,分数score,和比例ratio", notes="获取用户的排名rank,分数score,和比例ratio")
@ApiImplicitParams({
@ApiImplicitParam(name = "matchSeason", value = "赛季; s01", required = false, dataType = "String"),
@ApiImplicitParam(name = "matchType", value = "竞答|学习类型: wset1|daily|pk", required = false, dataType = "String"),
@ApiImplicitParam(name = "matchTeam", value = "竞答队伍: uid_001", required = false, 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/match/rank/query", method = RequestMethod.GET)
public JSONResult RockwellQueryMatchRank(
@RequestParam(value = "matchSeason", required = false, defaultValue = "0") String matchSeason,
@RequestParam(value = "matchType", required = false, defaultValue = "0") String matchType,
@RequestParam(value = "matchTeam", required = false, defaultValue = "0") String matchTeam,
@RequestParam(value = "pageNum", required = false, defaultValue = "1") int pageNum,
@RequestParam(value = "pageCount", required = false, defaultValue = "5") int pageCount
) {
return keyService.Rockwell_keyServiceGetV_match_rank(matchSeason, matchType, matchTeam);
}
// match rank api 更新tbl_match_rank的defaultType值
@ApiOperation(value="更新tbl_match_rank的defaultType值", notes="更新tbl_match_rank的defaultType值")
@ApiImplicitParams({
})
@RequestMapping(value = "/nyx/match/rank/update", method = RequestMethod.POST)
@ResponseBody
public void RockwellUpdateMatchRankDefaultType(
@RequestBody List<Rockwell_keyV_match_rank> Rockwell_keyV_match_rank
) {
keyService.Rockwell_keyServiceUpdateT_match_rank_defaultType(Rockwell_keyV_match_rank);
}
// 4.0 post info api
@ApiOperation(value="获取用户的post info", notes="获取用户的post info")
......@@ -278,88 +188,6 @@ public class NyxApiController {
keyService.Rockwell_keyServiceAddT_postLike(postId);
}
// 5.0 pair api PairApi-1.1
@ApiOperation(value="获取配餐的pairing信息", notes="获取配餐的pairing信息")
@ApiImplicitParams({
@ApiImplicitParam(name = "userId", value = "用户id", required = false, dataType = "String"),
@ApiImplicitParam(name = "strSearchName", value = "关键词", required = false, 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/pair/query", method = RequestMethod.GET)
public JSONResult RockwellQueryPair(
@RequestParam(value = "userId", required = false, defaultValue = "0") String userId,
@RequestParam(value = "strSearchName", required = false, defaultValue = "0") String strSearchName,
@RequestParam(value = "pageNum", required = false, defaultValue = "1") int pageNum,
@RequestParam(value = "pageCount", required = false, defaultValue = "5") int pageCount
) {
return keyService.Rockwell_keyServiceGetT_pair(userId, strSearchName, pageNum, pageCount);
}
// 5.1 pair api add PairApi-1.2
@ApiOperation(value="为pair添加pairing,对应tbl_pairing", notes="为t_pairing添加pairing,对应tbl_pairing")
@ApiImplicitParams({
@ApiImplicitParam(name = "userId", value = "用户id", required = false, dataType = "String"),
@ApiImplicitParam(name = "food", value = "food名称", required = false, dataType = "String"),
@ApiImplicitParam(name = "wineName", value = "wine名称", required = false, dataType = "String"),
@ApiImplicitParam(name = "wineDesc", value = "wine描述", required = false, dataType = "String"),
@ApiImplicitParam(name = "imgLink", value = "wine图片链接", required = false, dataType = "String"),
@ApiImplicitParam(name = "wineLink", value = "wine链接", required = false, dataType = "String"),
@ApiImplicitParam(name = "sourceLink", value = "source链接", required = false, dataType = "String")
})
@RequestMapping(value = "/nyx/pair/add/item", method = RequestMethod.POST)
@ResponseBody
public void RockwellAddPairItem(
@RequestParam(value = "userId", required = false, defaultValue = "0") String userId,
@RequestParam(value = "food", required = false, defaultValue = "0") String food,
@RequestParam(value = "wineName", required = false, defaultValue = "0") String wineName,
@RequestParam(value = "wineDesc", required = false, defaultValue = "0") String wineDesc,
@RequestParam(value = "imgLink", required = false, defaultValue = "0") String imgLink,
@RequestParam(value = "wineLink", required = false, defaultValue = "0") String wineLink,
@RequestParam(value = "sourceLink", required = false, defaultValue = "0") String sourceLink
) throws UnsupportedEncodingException
{
keyService.Rockwell_keyServiceAddT_pair(userId, food, wineName, wineDesc, imgLink, wineLink, sourceLink);
}
// 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"?>
......@@ -98,48 +98,45 @@ limitations under the License.
values (#{id}, #{questionFkId}, #{userFkId} , #{userComment}, #{createDatetime})
</insert>
<!-- match api1-1 新增一条 match 记录 -->
<!-- match api1-1 新增一条 match 记录 update jscat 20200731 -->
<insert id="addT_matchList" parameterType="cn.com.fun.nyxkey.api.domain.query.Rockwell_keyT_matchQuery">
insert into tbl_match(match_id, match_season, match_type, match_team, match_result,match_score,team_type, quiz_index, rank_score, create_datetime,update_datetime)
insert into tbl_match(match_id, member_id, user_id, match_status, match_point, match_result, qrcode_url, create_datetime,update_datetime)
values
<foreach collection="listRockwell_keyT_match" index="index" item="item" open="" separator="," close="">
(
#{item.matchId},
#{item.matchSeason},
#{item.matchType},
#{item.matchTeam},
#{item.memberId},
#{item.userId},
#{item.matchStatus},
#{item.matchPoint},
#{item.matchResult},
#{item.matchScore},
#{item.teamType},
#{item.quizIndex},
#{item.rankScore},
#{item.qrcodeUrl},
#{item.createDatetime},
#{item.updateDatetime}
)
</foreach>
</insert>
<!-- match api1-2 新增一条 match 记录 -->
<!-- match api1-2 新增一条 tbl_match 记录 update jscat 20200731 -->
<insert id="addT_matchItem" parameterType="cn.com.fun.nyxkey.api.domain.Rockwell_keyT_match">
insert into tbl_match(match_id, match_season, match_type, match_team, match_result,match_score,team_type, quiz_index, rank_score, create_datetime,update_datetime)
insert into tbl_match(match_id, member_id, user_id, match_status, match_point, match_result, qrcode_url, create_datetime,update_datetime)
values
(
#{matchId},
#{matchSeason},
#{matchType},
#{matchTeam},
#{memberId},
#{userId},
#{matchStatus},
#{matchPoint},
#{matchResult},
#{matchScore},
#{teamType},
#{quizIndex},
#{rankScore},
#{qrcodeUrl},
#{createDatetime},
#{updateDatetime}
)
</insert>
<!-- match api1-3 获取t_match的值
match_id is a MUST
match_id is a MUST update jscat 20200731
-->
<select id="getT_match_by_matchid" parameterType="cn.com.fun.nyxkey.api.domain.query.Rockwell_keyT_matchQuery"
resultType="cn.com.fun.nyxkey.api.domain.Rockwell_keyT_match">
......@@ -148,94 +145,53 @@ limitations under the License.
AND match_id=#{matchId}
</select>
<!-- match api 1-5 获取t_match的值
-->
<!-- match api 1-5 获取t_match的值 update jscat 20200731 -->
<select id="getT_match_by_page" parameterType="cn.com.fun.nyxkey.api.domain.query.Rockwell_keyT_matchQuery"
resultType="cn.com.fun.nyxkey.api.domain.Rockwell_keyT_match">
select * from tbl_match
WHERE 1=1
<if test="matchSeason != null and matchSeason != '' ">
AND match_season=#{matchSeason}
<if test="memberId != null and memberId != '' ">
AND member_id=#{memberId}
</if>
<if test="matchTeam != null and matchTeam != '' ">
AND match_team=#{matchTeam}
<if test="userId != null and userId != '' ">
AND user_id=#{userId}
</if>
<if test="matchType != null and matchType != '' ">
AND match_type=#{matchType}
<if test="matchStatus != null and matchStatus != '' ">
AND match_status=#{matchStatus}
</if>
<if test="pagination != null ">
<include refid="pagination"/>
</if>
</select>
<!-- match rank
3 API:
- genT_match_rank
- getView_match_rank
- updateT_match_rank_defaultType
api 3.1 生成t_match_rank的值 to tbl_match_rank
-->
<select id="genT_match_rank" parameterType="cn.com.fun.nyxkey.api.domain.query.Rockwell_keyT_matchQuery">
REPLACE INTO tbl_match_rank(rank_id, match_season, match_type, match_team, score, rank, total_match, total_quiz, ratio_rank, ratio_finish, create_datetime, update_datetime)
SELECT CONCAT("rid_",match_season,"_",match_type,"_",match_team) AS rank_id , match_season, match_type, match_team, score, rank, total_match, total_quiz, ratio_rank, ratio_finish, NOW() AS create_datetime, NOW() AS update_datetime FROM
(
SELECT objA.match_season, objA.match_type, objA.match_team, objA.score, objA.rank, objB.total AS total_match, objC.total AS total_quiz, FORMAT((objB.total-objA.rank+1)/objB.total,2) AS ratio_rank, FORMAT(objA.score/objC.total,2) AS ratio_finish
FROM
(
SELECT match_season, match_type, match_team, score,
CASE WHEN @p=season_type THEN @row:=@row+1 ELSE @row:=1 END rownum,
IF( @p=season_type,
CASE
WHEN @s=score_minus THEN @r
WHEN @s:=score_minus THEN @r:=@row
END,
@r:=1 ) AS rank,
@s:=score_minus,
@p:=season_type
FROM view_match_score
WHERE 1=1
<if test="matchSeason != null and matchSeason != '' ">
AND match_season=#{matchSeason}
</if>
ORDER BY match_season ASC, match_type ASC, score DESC
) objA
LEFT JOIN view_match_type_total objB ON objA.match_type=objB.match_type AND objA.match_season=objB.match_season
LEFT JOIN view_quiz_type_total objC ON objA.match_type=objC.quiz_type
) aa
</select>
<!-- match rank api 3.2 从 view_match_rank 获取 view_match_rank
-->
<select id="getV_match_rank" parameterType="cn.com.fun.nyxkey.api.domain.query.Rockwell_keyT_matchQuery" resultType="cn.com.fun.nyxkey.api.domain.Rockwell_keyV_match_rank">
SELECT * FROM view_match_rank
WHERE 1=1
<if test="matchSeason != null and matchSeason != '' ">
AND match_season=#{matchSeason}
</if>
<if test="matchTeam != null and matchTeam != '' ">
AND match_team=#{matchTeam}
</if>
<if test="matchType != null and matchType != '' ">
AND match_type=#{matchType}
</if>
<!-- match api 1-6 更新match_status的状态 -->
<select id="updateT_match_status" parameterType="cn.com.fun.nyxkey.api.domain.query.Rockwell_keyT_matchQuery">
update tbl_match
set match_status=0
where match_id=#{matchId}
</select>
<!-- match rank api 3.3 从 更新t_match_rank的defaultType值
-->
<select id="updateT_match_rank_defaultType" parameterType="cn.com.fun.nyxkey.api.domain.query.Rockwell_keyT_matchQuery">
REPLACE into tbl_match_rank_default_type
<!-- match api1-7 新增一条 tbl_match_bonus 记录 update jscat 20200731 -->
<insert id="addT_match_bonusItem" parameterType="cn.com.fun.nyxkey.api.domain.Rockwell_keyT_match_bonus">
insert into tbl_match_bonus(match_id, user_id, user_name, bonus_point, create_datetime,update_datetime)
values
<foreach collection="listRockwell_keyV_match_rank" index="index" item="item" open="" separator="," close="">
(
#{item.rankId},
#{item.defaultType},
#{item.createDatetime},
#{item.updateDatetime}
)
</foreach>
(
#{matchId},
#{userId},
#{userName},
#{bonusPoint},
#{createDatetime},
#{updateDatetime}
)
</insert>
<!-- match api 1-8 获取v_match_point的值 update jscat 20200731 -->
<select id="getV_match_point_by_matchid" parameterType="cn.com.fun.nyxkey.api.domain.query.Rockwell_keyT_matchQuery"
resultType="cn.com.fun.nyxkey.api.domain.Rockwell_keyV_match_point">
select * from view_match_point
where 1=1
AND match_id=#{matchId}
</select>
<!-- post api 4.1 从 view_post_info 获取 post信息
......@@ -273,59 +229,5 @@ limitations under the License.
WHERE post_id=#{postId}
</select>
<select id="getT_pair" parameterType="cn.com.fun.nyxkey.api.domain.query.Rockwell_keyT_pairQuery" resultType="cn.com.fun.nyxkey.api.domain.Rockwell_keyT_pair">
SELECT * FROM tbl_pairing
WHERE 1=1
<if test="userId != null and userId != '' ">
AND ( user_id = #{userId} )
</if>
<foreach collection="listStrSearchName" index="index" item="item" open="" separator=" " close="">
AND ( food LIKE CONCAT('%',#{item},'%') OR CONCAT(wine_name,wine_desc) LIKE CONCAT('%',#{item},'%'))
</foreach>
order by num_like desc, create_datetime desc
<if test="pagination != null ">
<include refid="pagination"/>
</if>
</select>
<!-- pair api 添加一条pair信息 -->
<insert id="addT_pair" parameterType="cn.com.fun.nyxkey.api.domain.Rockwell_keyT_pair">
insert into tbl_pairing (pair_id, user_id, food, wine_name, wine_desc, img_link, wine_link, source_link, num_like, create_datetime, update_datetime)
values (#{pairId}, #{userId}, #{food}, #{wineName}, #{wineDesc}, #{imgLink}, #{wineLink}, #{sourceLink}, '0', #{createDatetime}, #{updateDatetime})
</insert>
<!-- 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
<if test="city != null and city != '' ">
AND city=#{city}
</if>
order by city asc, district DESC
</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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论