Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/main/java/com/sztzjy/money_management/controller/GradeController.java
master
xiaoCJ 5 months ago
commit 5e00962164

@ -42,7 +42,7 @@ public class CaseController {
@Autowired
private ComputeService computeService;
@Autowired
private p2pProductMapper p2pProductMapper;
private p2pDataMapper p2pDataMapper;
@PostMapping("/insertCase")
@ApiOperation("新增/编辑案例学生端新增传isAnswer为学生答案+userId")
@ -235,8 +235,8 @@ public class CaseController {
@PostMapping("getP2PProductById")
@ApiOperation("根据ID查询单个P2P产品")
@AnonymousAccess
public ResultEntity<p2pProduct> getP2PProductById(@RequestParam String id) {
p2pProduct p2pProducts = p2pProductMapper.selectByPrimaryKey(id);
public ResultEntity<p2pData> getP2PProductById(@RequestParam String id) {
p2pData p2pProducts = p2pDataMapper.selectByPrimaryKey(id);
return new ResultEntity<>(p2pProducts);
}

@ -65,6 +65,7 @@ public class ChapterController {
ChapterExample chapterExample = new ChapterExample();
ChapterExample.Criteria criteria = chapterExample.createCriteria();
criteria.andSourceEqualTo(Constant.BUILT_IN_SCHOOL_ID);
chapterExample.setOrderByClause("add_time asc");
List<Chapter> chapters = chapterMapper.selectByExample(chapterExample);
return new ResultEntity<>(HttpStatus.OK, "章节查询成功",chapters);
}

@ -303,8 +303,10 @@ public class GradeController {
} else {
ScoreRank scoreRank = scoreRankList.get(0);
Integer totalUseTime = synthesisPlanClientMapper.getTotalUseTime(userId);
int i = totalUseTime == null ? 0 : totalUseTime;
synthesisPlanReturnDto.setUseTime(BigDecimal.valueOf(i));
if (totalUseTime==null){
totalUseTime=0;
}
synthesisPlanReturnDto.setUseTime(BigDecimal.valueOf(totalUseTime));
synthesisPlanReturnDto.setTrainingScore(scoreRank.getZhghScore().multiply(totalWeight.getZhgh()));
synthesisPlanReturnDto.setTrainingTotalScore(scoreRank.getZhghScore());
}

@ -6,14 +6,21 @@ import com.sztzjy.money_management.annotation.AnonymousAccess;
import com.sztzjy.money_management.entity.*;
import com.sztzjy.money_management.mapper.*;
import com.sztzjy.money_management.util.ResultEntity;
import com.sztzjy.money_management.util.file.IFileUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.FileSystemResource;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.util.List;
@RestController
@ -29,7 +36,7 @@ public class ProductCenter {
@Autowired
InsuranceProMapper insuranceProMapper;
@Autowired
p2pProductMapper p2pProductMapper;
p2pDataMapper p2pDataMapper;
@Autowired
ObjectiveQuestionMapper objectiveQuestionMapper;
@ -89,18 +96,18 @@ public class ProductCenter {
@PostMapping("selectP2PProduct")
@ApiOperation("P2P产品查询")
@AnonymousAccess
public ResultEntity<PageInfo<p2pProduct>> selectP2PProduct(@RequestParam(required = false) String productName,
public ResultEntity<PageInfo<p2pData>> selectP2PProduct(@RequestParam(required = false) String productName,
@RequestParam Integer index,
@RequestParam Integer size) {
PageHelper.startPage(index, size);
p2pProductExample example = new p2pProductExample();
p2pDataExample example = new p2pDataExample();
if (productName != null) {
p2pProductExample.Criteria criteria = example.createCriteria();
criteria.andP2pNameLike("%" + productName + "%");
p2pDataExample.Criteria criteria = example.createCriteria();
criteria.andNameLike("%" + productName + "%");
}
example.setOrderByClause("update_time asc");
List<p2pProduct> p2pProducts = p2pProductMapper.selectByExample(example);
PageInfo<p2pProduct> pageInfo = new PageInfo<>(p2pProducts);
example.setOrderByClause("code_id asc");
List<p2pData> p2pData = p2pDataMapper.selectByExample(example);
PageInfo<p2pData> pageInfo = new PageInfo<>(p2pData);
return new ResultEntity<>(HttpStatus.OK, "P2P产品查询成功", pageInfo);
}
@ -139,5 +146,35 @@ public class ProductCenter {
return new ResultEntity<>(HttpStatus.OK, "保险产品查询成功!", pageInfo);
}
@Value("${file.path}")
private String filePath;
@GetMapping("/getInsuranceProPDF")
@ApiOperation("查询保险产品PDF")
@AnonymousAccess
public ResponseEntity<FileSystemResource> getInsuranceProPDF(@RequestParam String detailConditionContent, HttpServletResponse response) {
String videoPath = filePath + detailConditionContent;
File videoFile = new File(videoPath);
if (videoFile.exists()) {
FileSystemResource fileSystemResource = new FileSystemResource(videoFile);
return ResponseEntity.ok()
.contentType(MediaType.parseMediaType("application/pdf"))
.body(fileSystemResource);
} else {
return ResponseEntity.notFound().build();
}
}
@Autowired
IFileUtil fileUtil;
//下载保险产品文件
@GetMapping("downloadResource")
@ApiOperation("下载资源文件")
@AnonymousAccess
public void downloadResource(@RequestParam String detailConditionContent,@RequestParam String name, HttpServletResponse response) {
fileUtil.download(response, name, detailConditionContent);
}
}

@ -80,7 +80,7 @@ public class StatisticsController {
if(stuTheoryRecord!=null){
stuStatisticsDto.setKszxTime(stuTheoryRecord.getTotalDuration());
}
stuStatisticsDto.setTotalTime(BigDecimal.valueOf(khanTime+zhghTime).add(stuTheoryRecord.getTotalDuration()));
stuStatisticsDto.setTotalTime(BigDecimal.valueOf(khanTime+zhghTime).add(stuTheoryRecord==null?BigDecimal.ZERO:stuTheoryRecord.getTotalDuration()));
}
return new ResultEntity<>(HttpStatus.OK, "我的成绩、有效时长、各模块用时返回成功!",stuStatisticsDto);
}

@ -0,0 +1,85 @@
package com.sztzjy.money_management.entity;
import io.swagger.annotations.ApiModelProperty;
/**
*
* @author xcj
* p2p_data
*/
public class p2pData {
private String codeId;
@ApiModelProperty("证券代码")
private String code;
@ApiModelProperty("证券名称")
private String name;
@ApiModelProperty("证券板块")
private String sectorName;
@ApiModelProperty("所属行业")
private String industryName;
@ApiModelProperty("年化收益率%")
private String annualReturn;
@ApiModelProperty("市盈率PE")
private String peratio;
public String getCodeId() {
return codeId;
}
public void setCodeId(String codeId) {
this.codeId = codeId == null ? null : codeId.trim();
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code == null ? null : code.trim();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getSectorName() {
return sectorName;
}
public void setSectorName(String sectorName) {
this.sectorName = sectorName == null ? null : sectorName.trim();
}
public String getIndustryName() {
return industryName;
}
public void setIndustryName(String industryName) {
this.industryName = industryName == null ? null : industryName.trim();
}
public String getAnnualReturn() {
return annualReturn;
}
public void setAnnualReturn(String annualReturn) {
this.annualReturn = annualReturn == null ? null : annualReturn.trim();
}
public String getPeratio() {
return peratio;
}
public void setPeratio(String peratio) {
this.peratio = peratio == null ? null : peratio.trim();
}
}

@ -0,0 +1,689 @@
package com.sztzjy.money_management.entity;
import java.util.ArrayList;
import java.util.List;
public class p2pDataExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public p2pDataExample() {
oredCriteria = new ArrayList<>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andCodeIdIsNull() {
addCriterion("code_id is null");
return (Criteria) this;
}
public Criteria andCodeIdIsNotNull() {
addCriterion("code_id is not null");
return (Criteria) this;
}
public Criteria andCodeIdEqualTo(String value) {
addCriterion("code_id =", value, "codeId");
return (Criteria) this;
}
public Criteria andCodeIdNotEqualTo(String value) {
addCriterion("code_id <>", value, "codeId");
return (Criteria) this;
}
public Criteria andCodeIdGreaterThan(String value) {
addCriterion("code_id >", value, "codeId");
return (Criteria) this;
}
public Criteria andCodeIdGreaterThanOrEqualTo(String value) {
addCriterion("code_id >=", value, "codeId");
return (Criteria) this;
}
public Criteria andCodeIdLessThan(String value) {
addCriterion("code_id <", value, "codeId");
return (Criteria) this;
}
public Criteria andCodeIdLessThanOrEqualTo(String value) {
addCriterion("code_id <=", value, "codeId");
return (Criteria) this;
}
public Criteria andCodeIdLike(String value) {
addCriterion("code_id like", value, "codeId");
return (Criteria) this;
}
public Criteria andCodeIdNotLike(String value) {
addCriterion("code_id not like", value, "codeId");
return (Criteria) this;
}
public Criteria andCodeIdIn(List<String> values) {
addCriterion("code_id in", values, "codeId");
return (Criteria) this;
}
public Criteria andCodeIdNotIn(List<String> values) {
addCriterion("code_id not in", values, "codeId");
return (Criteria) this;
}
public Criteria andCodeIdBetween(String value1, String value2) {
addCriterion("code_id between", value1, value2, "codeId");
return (Criteria) this;
}
public Criteria andCodeIdNotBetween(String value1, String value2) {
addCriterion("code_id not between", value1, value2, "codeId");
return (Criteria) this;
}
public Criteria andCodeIsNull() {
addCriterion("code is null");
return (Criteria) this;
}
public Criteria andCodeIsNotNull() {
addCriterion("code is not null");
return (Criteria) this;
}
public Criteria andCodeEqualTo(String value) {
addCriterion("code =", value, "code");
return (Criteria) this;
}
public Criteria andCodeNotEqualTo(String value) {
addCriterion("code <>", value, "code");
return (Criteria) this;
}
public Criteria andCodeGreaterThan(String value) {
addCriterion("code >", value, "code");
return (Criteria) this;
}
public Criteria andCodeGreaterThanOrEqualTo(String value) {
addCriterion("code >=", value, "code");
return (Criteria) this;
}
public Criteria andCodeLessThan(String value) {
addCriterion("code <", value, "code");
return (Criteria) this;
}
public Criteria andCodeLessThanOrEqualTo(String value) {
addCriterion("code <=", value, "code");
return (Criteria) this;
}
public Criteria andCodeLike(String value) {
addCriterion("code like", value, "code");
return (Criteria) this;
}
public Criteria andCodeNotLike(String value) {
addCriterion("code not like", value, "code");
return (Criteria) this;
}
public Criteria andCodeIn(List<String> values) {
addCriterion("code in", values, "code");
return (Criteria) this;
}
public Criteria andCodeNotIn(List<String> values) {
addCriterion("code not in", values, "code");
return (Criteria) this;
}
public Criteria andCodeBetween(String value1, String value2) {
addCriterion("code between", value1, value2, "code");
return (Criteria) this;
}
public Criteria andCodeNotBetween(String value1, String value2) {
addCriterion("code not between", value1, value2, "code");
return (Criteria) this;
}
public Criteria andNameIsNull() {
addCriterion("name is null");
return (Criteria) this;
}
public Criteria andNameIsNotNull() {
addCriterion("name is not null");
return (Criteria) this;
}
public Criteria andNameEqualTo(String value) {
addCriterion("name =", value, "name");
return (Criteria) this;
}
public Criteria andNameNotEqualTo(String value) {
addCriterion("name <>", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThan(String value) {
addCriterion("name >", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThanOrEqualTo(String value) {
addCriterion("name >=", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThan(String value) {
addCriterion("name <", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThanOrEqualTo(String value) {
addCriterion("name <=", value, "name");
return (Criteria) this;
}
public Criteria andNameLike(String value) {
addCriterion("name like", value, "name");
return (Criteria) this;
}
public Criteria andNameNotLike(String value) {
addCriterion("name not like", value, "name");
return (Criteria) this;
}
public Criteria andNameIn(List<String> values) {
addCriterion("name in", values, "name");
return (Criteria) this;
}
public Criteria andNameNotIn(List<String> values) {
addCriterion("name not in", values, "name");
return (Criteria) this;
}
public Criteria andNameBetween(String value1, String value2) {
addCriterion("name between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andNameNotBetween(String value1, String value2) {
addCriterion("name not between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andSectorNameIsNull() {
addCriterion("sector_name is null");
return (Criteria) this;
}
public Criteria andSectorNameIsNotNull() {
addCriterion("sector_name is not null");
return (Criteria) this;
}
public Criteria andSectorNameEqualTo(String value) {
addCriterion("sector_name =", value, "sectorName");
return (Criteria) this;
}
public Criteria andSectorNameNotEqualTo(String value) {
addCriterion("sector_name <>", value, "sectorName");
return (Criteria) this;
}
public Criteria andSectorNameGreaterThan(String value) {
addCriterion("sector_name >", value, "sectorName");
return (Criteria) this;
}
public Criteria andSectorNameGreaterThanOrEqualTo(String value) {
addCriterion("sector_name >=", value, "sectorName");
return (Criteria) this;
}
public Criteria andSectorNameLessThan(String value) {
addCriterion("sector_name <", value, "sectorName");
return (Criteria) this;
}
public Criteria andSectorNameLessThanOrEqualTo(String value) {
addCriterion("sector_name <=", value, "sectorName");
return (Criteria) this;
}
public Criteria andSectorNameLike(String value) {
addCriterion("sector_name like", value, "sectorName");
return (Criteria) this;
}
public Criteria andSectorNameNotLike(String value) {
addCriterion("sector_name not like", value, "sectorName");
return (Criteria) this;
}
public Criteria andSectorNameIn(List<String> values) {
addCriterion("sector_name in", values, "sectorName");
return (Criteria) this;
}
public Criteria andSectorNameNotIn(List<String> values) {
addCriterion("sector_name not in", values, "sectorName");
return (Criteria) this;
}
public Criteria andSectorNameBetween(String value1, String value2) {
addCriterion("sector_name between", value1, value2, "sectorName");
return (Criteria) this;
}
public Criteria andSectorNameNotBetween(String value1, String value2) {
addCriterion("sector_name not between", value1, value2, "sectorName");
return (Criteria) this;
}
public Criteria andIndustryNameIsNull() {
addCriterion("industry_name is null");
return (Criteria) this;
}
public Criteria andIndustryNameIsNotNull() {
addCriterion("industry_name is not null");
return (Criteria) this;
}
public Criteria andIndustryNameEqualTo(String value) {
addCriterion("industry_name =", value, "industryName");
return (Criteria) this;
}
public Criteria andIndustryNameNotEqualTo(String value) {
addCriterion("industry_name <>", value, "industryName");
return (Criteria) this;
}
public Criteria andIndustryNameGreaterThan(String value) {
addCriterion("industry_name >", value, "industryName");
return (Criteria) this;
}
public Criteria andIndustryNameGreaterThanOrEqualTo(String value) {
addCriterion("industry_name >=", value, "industryName");
return (Criteria) this;
}
public Criteria andIndustryNameLessThan(String value) {
addCriterion("industry_name <", value, "industryName");
return (Criteria) this;
}
public Criteria andIndustryNameLessThanOrEqualTo(String value) {
addCriterion("industry_name <=", value, "industryName");
return (Criteria) this;
}
public Criteria andIndustryNameLike(String value) {
addCriterion("industry_name like", value, "industryName");
return (Criteria) this;
}
public Criteria andIndustryNameNotLike(String value) {
addCriterion("industry_name not like", value, "industryName");
return (Criteria) this;
}
public Criteria andIndustryNameIn(List<String> values) {
addCriterion("industry_name in", values, "industryName");
return (Criteria) this;
}
public Criteria andIndustryNameNotIn(List<String> values) {
addCriterion("industry_name not in", values, "industryName");
return (Criteria) this;
}
public Criteria andIndustryNameBetween(String value1, String value2) {
addCriterion("industry_name between", value1, value2, "industryName");
return (Criteria) this;
}
public Criteria andIndustryNameNotBetween(String value1, String value2) {
addCriterion("industry_name not between", value1, value2, "industryName");
return (Criteria) this;
}
public Criteria andAnnualReturnIsNull() {
addCriterion("annual_return is null");
return (Criteria) this;
}
public Criteria andAnnualReturnIsNotNull() {
addCriterion("annual_return is not null");
return (Criteria) this;
}
public Criteria andAnnualReturnEqualTo(String value) {
addCriterion("annual_return =", value, "annualReturn");
return (Criteria) this;
}
public Criteria andAnnualReturnNotEqualTo(String value) {
addCriterion("annual_return <>", value, "annualReturn");
return (Criteria) this;
}
public Criteria andAnnualReturnGreaterThan(String value) {
addCriterion("annual_return >", value, "annualReturn");
return (Criteria) this;
}
public Criteria andAnnualReturnGreaterThanOrEqualTo(String value) {
addCriterion("annual_return >=", value, "annualReturn");
return (Criteria) this;
}
public Criteria andAnnualReturnLessThan(String value) {
addCriterion("annual_return <", value, "annualReturn");
return (Criteria) this;
}
public Criteria andAnnualReturnLessThanOrEqualTo(String value) {
addCriterion("annual_return <=", value, "annualReturn");
return (Criteria) this;
}
public Criteria andAnnualReturnLike(String value) {
addCriterion("annual_return like", value, "annualReturn");
return (Criteria) this;
}
public Criteria andAnnualReturnNotLike(String value) {
addCriterion("annual_return not like", value, "annualReturn");
return (Criteria) this;
}
public Criteria andAnnualReturnIn(List<String> values) {
addCriterion("annual_return in", values, "annualReturn");
return (Criteria) this;
}
public Criteria andAnnualReturnNotIn(List<String> values) {
addCriterion("annual_return not in", values, "annualReturn");
return (Criteria) this;
}
public Criteria andAnnualReturnBetween(String value1, String value2) {
addCriterion("annual_return between", value1, value2, "annualReturn");
return (Criteria) this;
}
public Criteria andAnnualReturnNotBetween(String value1, String value2) {
addCriterion("annual_return not between", value1, value2, "annualReturn");
return (Criteria) this;
}
public Criteria andPeratioIsNull() {
addCriterion("peratio is null");
return (Criteria) this;
}
public Criteria andPeratioIsNotNull() {
addCriterion("peratio is not null");
return (Criteria) this;
}
public Criteria andPeratioEqualTo(String value) {
addCriterion("peratio =", value, "peratio");
return (Criteria) this;
}
public Criteria andPeratioNotEqualTo(String value) {
addCriterion("peratio <>", value, "peratio");
return (Criteria) this;
}
public Criteria andPeratioGreaterThan(String value) {
addCriterion("peratio >", value, "peratio");
return (Criteria) this;
}
public Criteria andPeratioGreaterThanOrEqualTo(String value) {
addCriterion("peratio >=", value, "peratio");
return (Criteria) this;
}
public Criteria andPeratioLessThan(String value) {
addCriterion("peratio <", value, "peratio");
return (Criteria) this;
}
public Criteria andPeratioLessThanOrEqualTo(String value) {
addCriterion("peratio <=", value, "peratio");
return (Criteria) this;
}
public Criteria andPeratioLike(String value) {
addCriterion("peratio like", value, "peratio");
return (Criteria) this;
}
public Criteria andPeratioNotLike(String value) {
addCriterion("peratio not like", value, "peratio");
return (Criteria) this;
}
public Criteria andPeratioIn(List<String> values) {
addCriterion("peratio in", values, "peratio");
return (Criteria) this;
}
public Criteria andPeratioNotIn(List<String> values) {
addCriterion("peratio not in", values, "peratio");
return (Criteria) this;
}
public Criteria andPeratioBetween(String value1, String value2) {
addCriterion("peratio between", value1, value2, "peratio");
return (Criteria) this;
}
public Criteria andPeratioNotBetween(String value1, String value2) {
addCriterion("peratio not between", value1, value2, "peratio");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

@ -0,0 +1,32 @@
package com.sztzjy.money_management.mapper;
import com.sztzjy.money_management.entity.p2pData;
import com.sztzjy.money_management.entity.p2pDataExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface p2pDataMapper {
long countByExample(p2pDataExample example);
int deleteByExample(p2pDataExample example);
int deleteByPrimaryKey(String codeId);
int insert(p2pData record);
int insertSelective(p2pData record);
List<p2pData> selectByExample(p2pDataExample example);
p2pData selectByPrimaryKey(String codeId);
int updateByExampleSelective(@Param("record") p2pData record, @Param("example") p2pDataExample example);
int updateByExample(@Param("record") p2pData record, @Param("example") p2pDataExample example);
int updateByPrimaryKeySelective(p2pData record);
int updateByPrimaryKey(p2pData record);
}

@ -40,6 +40,7 @@ public class ChapterServiceImpl implements ChapterService {
list.add(schoolId);
criteria.andSourceIn(list);
}
List<Chapter> chapters = chapterMapper.selectByExample(chapterExample);
return chapters;
}

@ -0,0 +1,243 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.sztzjy.money_management.mapper.p2pDataMapper">
<resultMap id="BaseResultMap" type="com.sztzjy.money_management.entity.p2pData">
<id column="code_id" jdbcType="VARCHAR" property="codeId" />
<result column="code" jdbcType="VARCHAR" property="code" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="sector_name" jdbcType="VARCHAR" property="sectorName" />
<result column="industry_name" jdbcType="VARCHAR" property="industryName" />
<result column="annual_return" jdbcType="VARCHAR" property="annualReturn" />
<result column="peratio" jdbcType="VARCHAR" property="peratio" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
code_id, code, name, sector_name, industry_name, annual_return, peratio
</sql>
<select id="selectByExample" parameterType="com.sztzjy.money_management.entity.p2pDataExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from p2p_data
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from p2p_data
where code_id = #{codeId,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from p2p_data
where code_id = #{codeId,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.sztzjy.money_management.entity.p2pDataExample">
delete from p2p_data
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.sztzjy.money_management.entity.p2pData">
insert into p2p_data (code_id, code, name,
sector_name, industry_name, annual_return,
peratio)
values (#{codeId,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
#{sectorName,jdbcType=VARCHAR}, #{industryName,jdbcType=VARCHAR}, #{annualReturn,jdbcType=VARCHAR},
#{peratio,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.money_management.entity.p2pData">
insert into p2p_data
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="codeId != null">
code_id,
</if>
<if test="code != null">
code,
</if>
<if test="name != null">
name,
</if>
<if test="sectorName != null">
sector_name,
</if>
<if test="industryName != null">
industry_name,
</if>
<if test="annualReturn != null">
annual_return,
</if>
<if test="peratio != null">
peratio,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="codeId != null">
#{codeId,jdbcType=VARCHAR},
</if>
<if test="code != null">
#{code,jdbcType=VARCHAR},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="sectorName != null">
#{sectorName,jdbcType=VARCHAR},
</if>
<if test="industryName != null">
#{industryName,jdbcType=VARCHAR},
</if>
<if test="annualReturn != null">
#{annualReturn,jdbcType=VARCHAR},
</if>
<if test="peratio != null">
#{peratio,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.money_management.entity.p2pDataExample" resultType="java.lang.Long">
select count(*) from p2p_data
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update p2p_data
<set>
<if test="record.codeId != null">
code_id = #{record.codeId,jdbcType=VARCHAR},
</if>
<if test="record.code != null">
code = #{record.code,jdbcType=VARCHAR},
</if>
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.sectorName != null">
sector_name = #{record.sectorName,jdbcType=VARCHAR},
</if>
<if test="record.industryName != null">
industry_name = #{record.industryName,jdbcType=VARCHAR},
</if>
<if test="record.annualReturn != null">
annual_return = #{record.annualReturn,jdbcType=VARCHAR},
</if>
<if test="record.peratio != null">
peratio = #{record.peratio,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update p2p_data
set code_id = #{record.codeId,jdbcType=VARCHAR},
code = #{record.code,jdbcType=VARCHAR},
name = #{record.name,jdbcType=VARCHAR},
sector_name = #{record.sectorName,jdbcType=VARCHAR},
industry_name = #{record.industryName,jdbcType=VARCHAR},
annual_return = #{record.annualReturn,jdbcType=VARCHAR},
peratio = #{record.peratio,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.money_management.entity.p2pData">
update p2p_data
<set>
<if test="code != null">
code = #{code,jdbcType=VARCHAR},
</if>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="sectorName != null">
sector_name = #{sectorName,jdbcType=VARCHAR},
</if>
<if test="industryName != null">
industry_name = #{industryName,jdbcType=VARCHAR},
</if>
<if test="annualReturn != null">
annual_return = #{annualReturn,jdbcType=VARCHAR},
</if>
<if test="peratio != null">
peratio = #{peratio,jdbcType=VARCHAR},
</if>
</set>
where code_id = #{codeId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.money_management.entity.p2pData">
update p2p_data
set code = #{code,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR},
sector_name = #{sectorName,jdbcType=VARCHAR},
industry_name = #{industryName,jdbcType=VARCHAR},
annual_return = #{annualReturn,jdbcType=VARCHAR},
peratio = #{peratio,jdbcType=VARCHAR}
where code_id = #{codeId,jdbcType=VARCHAR}
</update>
</mapper>
Loading…
Cancel
Save