数字营销实训算法第二轮修改

master
@t2652009480 7 months ago
parent f9b44585d1
commit caddc501a0

@ -25,6 +25,10 @@ public class Constant {
public static final String INPUT_TYPE_TEACHER= "0";
public static final String INPUT_TYPE_BUILT_IN= "1";
public static final String LINEAR_REGRESSION="线性回归";
public static final String LOGISTIC_REGRESSION="逻辑回归";

@ -1,6 +1,8 @@
package com.sztzjy.marketing.controller.stu;
import cn.hutool.core.util.IdUtil;
import com.sztzjy.marketing.annotation.AnonymousAccess;
import com.sztzjy.marketing.config.Constant;
import com.sztzjy.marketing.config.exception.handler.DigitalEconomyxception;
import com.sztzjy.marketing.entity.StuSpendingLevel;
import com.sztzjy.marketing.entity.StuTrainingOperateStepExample;
@ -25,6 +27,7 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.math.BigDecimal;
import java.text.DecimalFormat;
@ -194,7 +197,7 @@ public class StuDigitalMarketingModelController {
Apriori.iteration(Apriori.C,Apriori.L,support);
//根据最终的关联集,根据公式计算出各个关联事件
List<String> connection = Apriori.connection(confidence);
List<AssociationRulesDTO> connection = Apriori.connection(confidence);
return new ResultEntity(HttpStatus.OK,"成功",connection);
@ -212,14 +215,11 @@ public class StuDigitalMarketingModelController {
LinearRegression regression=new LinearRegression();
regression.fit(x,y);
double[] slopes = regression.getSlopes();
RAnalysisDTO rAnalysisDTO=new RAnalysisDTO();
rAnalysisDTO.setIntercept(regression.getIntercept());
for (int i = 0; i < slopes.length; i++) {
rAnalysisDTO.setSlopes(slopes[i]);
}
rAnalysisDTO.setSlopes(regression.getSlopes());
rAnalysisDTO.setType("线性回归");
return new ResultEntity(HttpStatus.OK,"成功",rAnalysisDTO);
}
@ -240,22 +240,51 @@ public class StuDigitalMarketingModelController {
RAnalysisDTO rAnalysisDTO=new RAnalysisDTO();
rAnalysisDTO.setIntercept(Double.parseDouble(df.format(model.getIntercept())));
rAnalysisDTO.setSlopes(Double.parseDouble(df.format(model.getCoefficient())));
rAnalysisDTO.setSlope(Double.parseDouble(df.format(model.getCoefficient())));
rAnalysisDTO.setType("逻辑回归");
return new ResultEntity(HttpStatus.OK,"成功",rAnalysisDTO);
}
@ApiOperation("线性回归/逻辑回归--预测")
@PostMapping("/prediction")
@AnonymousAccess
public ResultEntity prediction(@RequestBody LogisticPredictDTO logisticPredictDTO) {
DecimalFormat df = new DecimalFormat("#.0");
if(logisticPredictDTO.getType().equals(Constant.LINEAR_REGRESSION)){
// 创建线性回归模型
LinearRegression regression=new LinearRegression();
double predict = regression.predict(logisticPredictDTO.getRaX(), logisticPredictDTO.getIntercept(), logisticPredictDTO.getSlopes());
return new ResultEntity(HttpStatus.OK,"成功",df.format(predict));
}else {
// 创建一个逻辑回归模型实例,0.1学习率
LogisticRegression model = new LogisticRegression(0.1);
double predict = model.predict(logisticPredictDTO.getLX(), logisticPredictDTO.getSlope(), logisticPredictDTO.getIntercept());//预测
return new ResultEntity(HttpStatus.OK,"成功",df.format(predict));
}
}
@ApiOperation("情感分析/文本挖掘")
@PostMapping("/emotionalAnalysis")
@AnonymousAccess
public ResultEntity emotionalAnalysis(@ApiParam("用户ID") String userId,
@ApiParam("模型类别") String modelType,
@ApiParam("输入内容") String content) throws IOException {
return modelService.emotionalAnalysis(userId,modelType,content);
public ResultEntity emotionalAnalysis(@RequestBody EmotionalAnalysisDto emotionalAnalysisDto) throws IOException {
String id = emotionalAnalysisDto.getId();
String modelType = emotionalAnalysisDto.getModelType();
String content = emotionalAnalysisDto.getContent();
String userId = emotionalAnalysisDto.getUserId();
return modelService.emotionalAnalysis(userId,modelType,content,id);
}
@ApiOperation("批量导入")
@PostMapping("/batchImport")
@AnonymousAccess

@ -0,0 +1,229 @@
package com.sztzjy.marketing.controller.stu;
import cn.hutool.core.util.IdUtil;
import com.sztzjy.marketing.annotation.AnonymousAccess;
import com.sztzjy.marketing.config.Constant;
import com.sztzjy.marketing.entity.dto.*;
import com.sztzjy.marketing.util.excel.FilePortUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.checkerframework.checker.units.qual.C;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* @author tz
* @date 2024/8/19 10:14
*/
@Api(tags = "分析结果下载")
@RequestMapping("api/analysis")
@RestController
public class StuOnAnalysisController {
@ApiOperation("描述性统计表格下载")
@PostMapping("/dSExport")
@AnonymousAccess
public void dSExport(HttpServletResponse response, @RequestBody List<DescriptiveStatisticsDTO> dtoList) {
//导出的表名
String title = IdUtil.simpleUUID();
// List<String> list=new ArrayList<>();
// list.add(""); //表头第一个元素为空
// for (DescriptiveStatisticsDTO dto: dtoList) {
// list.add(dto.getStatistic());
// }
// //表中第一行表头字段
// String[] headers=list.toArray(new String[list.size()]); // 使用 list.toArray() 转换为 String数组
String[] headers={"", "平均数", "中位数", "众数", "标准差", "方差", "标准误差",
"峰度", "偏度", "最大值", "最小值", "求和", "观测数"};
List<DescriptiveStatistics> descriptiveStatistics=new ArrayList<>();
//实际数据结果集
for (DescriptiveStatisticsDTO dto: dtoList) {
descriptiveStatistics.add(dto.getStatistics());
}
//具体需要写入excel需要哪些字段这些字段取自UserReward类也就是上面的实际数据结果集的泛型
List<String> listColumn = Arrays.asList("field", "average", "median", "mode", "standardDeviation", "variance", "standardError",
"kurtosis", "skewness", "max", "min", "summation", "observations");
try {
FilePortUtil.exportExcel(response, title, headers, descriptiveStatistics, listColumn);
} catch (Exception e) {
e.printStackTrace();
}
}
@ApiOperation("聚类分析表格下载")
@PostMapping("/cAMExport")
@AnonymousAccess
public void cAMExport(HttpServletResponse response,@RequestBody List<List<Object>> data ) {
// Workbook workbook = new XSSFWorkbook();
// Sheet sheet = workbook.createSheet("Sheet1");
//
// for (int rowIndex = 0; rowIndex < data.size(); ++rowIndex) {
// Row row = sheet.createRow(rowIndex);
// for (int colIndex = 0; colIndex < data.get(rowIndex).size(); ++colIndex) {
// Object value = data.get(rowIndex).get(colIndex);
// if (value == null) {
// // 使用空字符串或其他显示文本代替 null 值
// Cell cell = row.createCell(colIndex);
// cell.setCellValue("");
// } else {
// Cell cell = row.createCell(colIndex);
// cell.setCellValue(value.toString());
// }
// }
// }
//
// try (FileOutputStream outputStream = new FileOutputStream("output.xlsx")) {
// workbook.write(outputStream);
// } catch (IOException e) {
// org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(cAMExport.class);
// logger.error("An error occurred while writing the Excel file.", e);
// }
//导出的表名
String title = IdUtil.simpleUUID();
//取到表头
List<String> list=new ArrayList<>();
for (int i = 0; i < data.size(); i++) {
for (int j = 0; j < data.get(i).size(); j++) {
list.add("field"+j);
}
}
//表中第一行表头字段
String[] headers=list.toArray(new String[list.size()]); // 使用 list.toArray() 转换为 String数组
//具体需要写入excel需要哪些字段这些字段取自UserReward类也就是上面的实际数据结果集的泛型
List<String> listColumn=new ArrayList<>();
//实际数据结果集
try {
FilePortUtil.exportExcel(response, title, headers, data, listColumn);
} catch (Exception e) {
e.printStackTrace();
}
}
@ApiOperation("关联规则挖掘表格下载")
@PostMapping("/aRMExport")
@AnonymousAccess
public void aRMExport(HttpServletResponse response, @RequestBody List<AssociationRulesDTO> dtoList) {
//导出的表名
String title = IdUtil.simpleUUID();
//表中第一行表头字段
String[] headers={"关联", "被关联", "置信度"};
//实际数据结果集
List<AssociationRules> list=new ArrayList<>();
for (int i = 0; i < dtoList.size(); i++) {
// 使用String.join()方法将元素以逗号和空格分隔
String correlation = String.join(", ", dtoList.get(i).getCorrelation());
String associated= String.join(", ", dtoList.get(i).getAssociated());
AssociationRules associationRules=new AssociationRules();
associationRules.setCorrelation(correlation);
associationRules.setAssociated(associated);
associationRules.setConfidenceLevel(dtoList.get(i).getConfidenceLevel());
list.add(associationRules);
}
//具体需要写入excel需要哪些字段这些字段取自UserReward类也就是上面的实际数据结果集的泛型
List<String> listColumn = Arrays.asList("correlation", "associated", "confidenceLevel");
try {
FilePortUtil.exportExcel(response, title, headers, list, listColumn);
} catch (Exception e) {
e.printStackTrace();
}
}
@ApiOperation("回归分析表格下载")
@PostMapping("/rAMExport")
@AnonymousAccess
public void rAMExport(HttpServletResponse response, @RequestBody RAnalysisExportDTO rAnalysisExportDTO) {
//导出的表名
String title = IdUtil.simpleUUID();
List<String> list=new ArrayList<>();
List<String> listColumn=new ArrayList<>();
list.add("回归系数值");
if(rAnalysisExportDTO.getType().equals(Constant.LINEAR_REGRESSION)){
list.add("线性回归常数项值");
//具体需要写入excel需要哪些字段这些字段取自UserReward类也就是上面的实际数据结果集的泛型
listColumn = Arrays.asList("intercept", "slopes", "type","prediction");
}else {
list.add("逻辑回归常数项值");
//具体需要写入excel需要哪些字段这些字段取自UserReward类也就是上面的实际数据结果集的泛型
listColumn = Arrays.asList("intercept", "slope", "type","prediction");
}
list.add("回归类型");
list.add("预测值");
//表中第一行表头字段
String[] headers=list.toArray(new String[list.size()]); // 使用 list.toArray() 转换为 String数组
//实际数据结果集
List<RAnalysisExportDTO> rAnalysisExportDTOS=new ArrayList<>();
rAnalysisExportDTOS.add(rAnalysisExportDTO);
try {
FilePortUtil.exportExcel(response, title, headers, rAnalysisExportDTOS, listColumn);
} catch (Exception e) {
e.printStackTrace();
}
}
}

@ -2,7 +2,6 @@ package com.sztzjy.marketing.entity;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
*
@ -10,7 +9,6 @@ import io.swagger.annotations.ApiModelProperty;
* @author whb
* stu_user_attribute
*/
@ApiModel("用户属性表")
public class StuUserAttribute {
@ApiModelProperty("id")
private Integer id;
@ -57,6 +55,9 @@ public class StuUserAttribute {
@ApiModelProperty("所在地")
private String location;
@ApiModelProperty("文本")
private String text;
public Integer getId() {
return id;
}
@ -176,4 +177,12 @@ public class StuUserAttribute {
public void setLocation(String location) {
this.location = location == null ? null : location.trim();
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text == null ? null : text.trim();
}
}

@ -47,7 +47,7 @@ public class StuUserBehavior {
private String goodsSubcategories;
@ApiModelProperty("用户行为类型")
private String userBehaviorType;
private Integer userBehaviorType;
@ApiModelProperty("行为日期")
private Date behaviorDate;
@ -58,6 +58,9 @@ public class StuUserBehavior {
@ApiModelProperty("更新时间")
private Date updateTime;
@ApiModelProperty("文本")
private String text;
public Integer getId() {
return id;
}
@ -154,12 +157,12 @@ public class StuUserBehavior {
this.goodsSubcategories = goodsSubcategories == null ? null : goodsSubcategories.trim();
}
public String getUserBehaviorType() {
public Integer getUserBehaviorType() {
return userBehaviorType;
}
public void setUserBehaviorType(String userBehaviorType) {
this.userBehaviorType = userBehaviorType == null ? null : userBehaviorType.trim();
public void setUserBehaviorType(Integer userBehaviorType) {
this.userBehaviorType = userBehaviorType;
}
public Date getBehaviorDate() {
@ -185,4 +188,12 @@ public class StuUserBehavior {
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text == null ? null : text.trim();
}
}

@ -945,62 +945,52 @@ public class StuUserBehaviorExample {
return (Criteria) this;
}
public Criteria andUserBehaviorTypeEqualTo(String value) {
public Criteria andUserBehaviorTypeEqualTo(Integer value) {
addCriterion("user_behavior_type =", value, "userBehaviorType");
return (Criteria) this;
}
public Criteria andUserBehaviorTypeNotEqualTo(String value) {
public Criteria andUserBehaviorTypeNotEqualTo(Integer value) {
addCriterion("user_behavior_type <>", value, "userBehaviorType");
return (Criteria) this;
}
public Criteria andUserBehaviorTypeGreaterThan(String value) {
public Criteria andUserBehaviorTypeGreaterThan(Integer value) {
addCriterion("user_behavior_type >", value, "userBehaviorType");
return (Criteria) this;
}
public Criteria andUserBehaviorTypeGreaterThanOrEqualTo(String value) {
public Criteria andUserBehaviorTypeGreaterThanOrEqualTo(Integer value) {
addCriterion("user_behavior_type >=", value, "userBehaviorType");
return (Criteria) this;
}
public Criteria andUserBehaviorTypeLessThan(String value) {
public Criteria andUserBehaviorTypeLessThan(Integer value) {
addCriterion("user_behavior_type <", value, "userBehaviorType");
return (Criteria) this;
}
public Criteria andUserBehaviorTypeLessThanOrEqualTo(String value) {
public Criteria andUserBehaviorTypeLessThanOrEqualTo(Integer value) {
addCriterion("user_behavior_type <=", value, "userBehaviorType");
return (Criteria) this;
}
public Criteria andUserBehaviorTypeLike(String value) {
addCriterion("user_behavior_type like", value, "userBehaviorType");
return (Criteria) this;
}
public Criteria andUserBehaviorTypeNotLike(String value) {
addCriterion("user_behavior_type not like", value, "userBehaviorType");
return (Criteria) this;
}
public Criteria andUserBehaviorTypeIn(List<String> values) {
public Criteria andUserBehaviorTypeIn(List<Integer> values) {
addCriterion("user_behavior_type in", values, "userBehaviorType");
return (Criteria) this;
}
public Criteria andUserBehaviorTypeNotIn(List<String> values) {
public Criteria andUserBehaviorTypeNotIn(List<Integer> values) {
addCriterion("user_behavior_type not in", values, "userBehaviorType");
return (Criteria) this;
}
public Criteria andUserBehaviorTypeBetween(String value1, String value2) {
public Criteria andUserBehaviorTypeBetween(Integer value1, Integer value2) {
addCriterion("user_behavior_type between", value1, value2, "userBehaviorType");
return (Criteria) this;
}
public Criteria andUserBehaviorTypeNotBetween(String value1, String value2) {
public Criteria andUserBehaviorTypeNotBetween(Integer value1, Integer value2) {
addCriterion("user_behavior_type not between", value1, value2, "userBehaviorType");
return (Criteria) this;
}

@ -3,7 +3,6 @@ package com.sztzjy.marketing.entity;
import java.math.BigDecimal;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
*
@ -11,8 +10,6 @@ import io.swagger.annotations.ApiModelProperty;
* @author whb
* stu_user_consumption_ability
*/
@ApiModel("用户消费能力表")
public class StuUserConsumptionAbility {
@ApiModelProperty("id")
private Integer id;
@ -68,6 +65,9 @@ public class StuUserConsumptionAbility {
@ApiModelProperty("更新时间")
private Date updateTime;
@ApiModelProperty("文本")
private String text;
public Integer getId() {
return id;
}
@ -211,4 +211,12 @@ public class StuUserConsumptionAbility {
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text == null ? null : text.trim();
}
}

@ -55,6 +55,9 @@ public class StuUserLoginActive {
@ApiModelProperty("更新时间")
private Date updateTime;
@ApiModelProperty("文本")
private String text;
public Integer getId() {
return id;
}
@ -174,4 +177,12 @@ public class StuUserLoginActive {
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text == null ? null : text.trim();
}
}

@ -0,0 +1,22 @@
package com.sztzjy.marketing.entity.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author tz
* @date 2024/8/19 14:38
*/
@Data
public class AssociationRules {
@ApiModelProperty("关联")
private String correlation;
@ApiModelProperty("被关联")
private String associated;
@ApiModelProperty("置信度")
private double confidenceLevel;
}

@ -19,4 +19,7 @@ public class AssociationRulesDTO {
@ApiModelProperty("置信度")
private double confidenceLevel;
@ApiModelProperty("规则")
private String rule;
}

@ -0,0 +1,19 @@
package com.sztzjy.marketing.entity.dto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiParam;
import lombok.Data;
/**
* @author tz
* @date 2024/8/19 10:33
*/
@Data
@Api(tags = "描述性统计下载表格数据")
public class DSExportDTO extends DescriptiveStatistics{
@ApiModelProperty("字段名")
private String field;
}

@ -46,4 +46,7 @@ public class DescriptiveStatistics {
@ApiModelProperty("观测数")
private Integer observations;
@ApiModelProperty("字段名")
private String field;
}

@ -1,5 +1,6 @@
package com.sztzjy.marketing.entity.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
@ -11,4 +12,5 @@ public class DescriptiveStatisticsDTO {
private String field;
private DescriptiveStatistics statistics;
}

@ -0,0 +1,22 @@
package com.sztzjy.marketing.entity.dto;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import org.springframework.web.bind.annotation.RequestParam;
import javax.persistence.Column;
import javax.xml.bind.annotation.XmlElement;
/**
* @author tz
* @date 2024/8/19 16:09
*/
@Data
public class EmotionalAnalysisDto {
private String userId;
private String modelType;
private String content;
@XmlElement(name = "optionalField", required = false)
private String id;
}

@ -0,0 +1,18 @@
package com.sztzjy.marketing.entity.dto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.ujmp.core.util.R;
/**
* @author tz
* @date 2024/8/19 9:38
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class LogisticPredictDTO extends RAnalysisDTO {
private double[] raX;
private double lX;
}

@ -1,5 +1,6 @@
package com.sztzjy.marketing.entity.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
@ -8,6 +9,12 @@ import lombok.Data;
*/
@Data
public class RAnalysisDTO {
@ApiModelProperty("回归系数值")
private double intercept;
private double slopes;
@ApiModelProperty("线性回归常数项值")
private double[] slopes;
@ApiModelProperty("逻辑回归常数项值")
private double slope;
@ApiModelProperty("线性回归/逻辑回归")
private String type;
}

@ -0,0 +1,16 @@
package com.sztzjy.marketing.entity.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* @author tz
* @date 2024/8/19 14:55
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class RAnalysisExportDTO extends RAnalysisDTO{
@ApiModelProperty("预测值")
private double prediction;
}

@ -0,0 +1,25 @@
package com.sztzjy.marketing.entity.dto;
import lombok.Data;
import java.util.List;
/**
* @author tz
* @date 2024/8/19 11:38
*/
@Data
public class cAMExport {
private double fieldOne;
private double fieldTow;
private double fieldThree;
private double fieldFour;
private double fieldFive;
private double fieldSix;
private double fieldSeven;
private double fieldEight;
private double fieldNine;
private double fieldTen;
private String type;
}

@ -0,0 +1,17 @@
package com.sztzjy.marketing.entity.dto;
import lombok.Data;
import java.util.List;
/**
* @author tz
* @date 2024/8/19 11:12
*/
@Data
public class cAMExportDTO {
private String field;
private List<cAMExport> cAMExports;
}

@ -3,10 +3,10 @@ package com.sztzjy.marketing.mapper;
import com.sztzjy.marketing.entity.StuUserAttribute;
import com.sztzjy.marketing.entity.StuUserAttributeExample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface StuUserAttributeMapper {
long countByExample(StuUserAttributeExample example);
@ -18,17 +18,21 @@ public interface StuUserAttributeMapper {
int insertSelective(StuUserAttribute record);
List<StuUserAttribute> selectByExampleWithBLOBs(StuUserAttributeExample example);
List<StuUserAttribute> selectByExample(StuUserAttributeExample example);
StuUserAttribute selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") StuUserAttribute record, @Param("example") StuUserAttributeExample example);
int updateByExampleWithBLOBs(@Param("record") StuUserAttribute record, @Param("example") StuUserAttributeExample example);
int updateByExample(@Param("record") StuUserAttribute record, @Param("example") StuUserAttributeExample example);
int updateByPrimaryKeySelective(StuUserAttribute record);
int updateByPrimaryKey(StuUserAttribute record);
int updateByPrimaryKeyWithBLOBs(StuUserAttribute record);
List<Map<String,StuUserAttribute>> selectByFields(List<String> fieldList, String table);
int updateByPrimaryKey(StuUserAttribute record);
}

@ -3,8 +3,10 @@ package com.sztzjy.marketing.mapper;
import com.sztzjy.marketing.entity.StuUserBehavior;
import com.sztzjy.marketing.entity.StuUserBehaviorExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface StuUserBehaviorMapper {
long countByExample(StuUserBehaviorExample example);
@ -16,15 +18,21 @@ public interface StuUserBehaviorMapper {
int insertSelective(StuUserBehavior record);
List<StuUserBehavior> selectByExampleWithBLOBs(StuUserBehaviorExample example);
List<StuUserBehavior> selectByExample(StuUserBehaviorExample example);
StuUserBehavior selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") StuUserBehavior record, @Param("example") StuUserBehaviorExample example);
int updateByExampleWithBLOBs(@Param("record") StuUserBehavior record, @Param("example") StuUserBehaviorExample example);
int updateByExample(@Param("record") StuUserBehavior record, @Param("example") StuUserBehaviorExample example);
int updateByPrimaryKeySelective(StuUserBehavior record);
int updateByPrimaryKeyWithBLOBs(StuUserBehavior record);
int updateByPrimaryKey(StuUserBehavior record);
}

@ -3,8 +3,10 @@ package com.sztzjy.marketing.mapper;
import com.sztzjy.marketing.entity.StuUserConsumptionAbility;
import com.sztzjy.marketing.entity.StuUserConsumptionAbilityExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface StuUserConsumptionAbilityMapper {
long countByExample(StuUserConsumptionAbilityExample example);
@ -16,17 +18,21 @@ public interface StuUserConsumptionAbilityMapper {
int insertSelective(StuUserConsumptionAbility record);
List<StuUserConsumptionAbility> selectByExampleWithBLOBs(StuUserConsumptionAbilityExample example);
List<StuUserConsumptionAbility> selectByExample(StuUserConsumptionAbilityExample example);
StuUserConsumptionAbility selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") StuUserConsumptionAbility record, @Param("example") StuUserConsumptionAbilityExample example);
int updateByExampleWithBLOBs(@Param("record") StuUserConsumptionAbility record, @Param("example") StuUserConsumptionAbilityExample example);
int updateByExample(@Param("record") StuUserConsumptionAbility record, @Param("example") StuUserConsumptionAbilityExample example);
int updateByPrimaryKeySelective(StuUserConsumptionAbility record);
int updateByPrimaryKey(StuUserConsumptionAbility record);
int updateByPrimaryKeyWithBLOBs(StuUserConsumptionAbility record);
List<StuUserConsumptionAbility> selectByFields(List<String> fieldList, String table);
int updateByPrimaryKey(StuUserConsumptionAbility record);
}

@ -3,8 +3,10 @@ package com.sztzjy.marketing.mapper;
import com.sztzjy.marketing.entity.StuUserLoginActive;
import com.sztzjy.marketing.entity.StuUserLoginActiveExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface StuUserLoginActiveMapper {
long countByExample(StuUserLoginActiveExample example);
@ -16,15 +18,21 @@ public interface StuUserLoginActiveMapper {
int insertSelective(StuUserLoginActive record);
List<StuUserLoginActive> selectByExampleWithBLOBs(StuUserLoginActiveExample example);
List<StuUserLoginActive> selectByExample(StuUserLoginActiveExample example);
StuUserLoginActive selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") StuUserLoginActive record, @Param("example") StuUserLoginActiveExample example);
int updateByExampleWithBLOBs(@Param("record") StuUserLoginActive record, @Param("example") StuUserLoginActiveExample example);
int updateByExample(@Param("record") StuUserLoginActive record, @Param("example") StuUserLoginActiveExample example);
int updateByPrimaryKeySelective(StuUserLoginActive record);
int updateByPrimaryKeyWithBLOBs(StuUserLoginActive record);
int updateByPrimaryKey(StuUserLoginActive record);
}

@ -15,7 +15,7 @@ import java.util.Map;
public interface StuDigitalMarketingModelService {
List<String> dropdownBox(String userId);
ResultEntity emotionalAnalysis(String userId, String modelType, String content) throws IOException;
ResultEntity emotionalAnalysis(String userId, String modelType, String content,String id) throws IOException;
ResultEntity descriptiveStatistics(Map<String, List<Double>> map, List<String> statistic, String userId);

@ -25,6 +25,8 @@ import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import static com.sztzjy.marketing.util.algorithm.BaiDuZhiNengYun.getAccessToken;
@ -78,7 +80,7 @@ public class StuDigitalMarketingModelServiceImpl implements StuDigitalMarketingM
}
@Override
public ResultEntity emotionalAnalysis(String userId, String modelType, String content) throws IOException {
public ResultEntity emotionalAnalysis(String userId, String modelType, String content,String id) throws IOException {
MediaType mediaType = MediaType.parse("application/json");
@ -122,8 +124,10 @@ public class StuDigitalMarketingModelServiceImpl implements StuDigitalMarketingM
if(modelType.equals(Constant.WORD_FREQUENCY)){ //词频分析
String string = this.filterPunctuation(content);
// 使用 HanLP 分词
List<Term> terms = HanLP.segment(content);
List<Term> terms = HanLP.segment(string);
// 创建词汇表
Map<String, Integer> wordCount = new HashMap<>();
// 统计词频
@ -166,6 +170,18 @@ public class StuDigitalMarketingModelServiceImpl implements StuDigitalMarketingM
return null;
}
// 过滤标点符号的函数
private String filterPunctuation(String originalContent) {
// 创建一个正则表达式,用于匹配所有标点符号
String punctuationPattern = "[\\p{Punct}]";
// 创建一个 Pattern 对象
Pattern pattern = Pattern.compile(punctuationPattern);
// 创建一个 Matcher 对象
Matcher matcher = pattern.matcher(originalContent);
// 使用 Matcher 的 replaceAll 方法替换所有匹配的标点符号为 ""
return matcher.replaceAll("");
}
@Override
public ResultEntity descriptiveStatistics(Map<String, List<Double>> map, List<String> statistic, String userId) {
@ -179,36 +195,38 @@ public class StuDigitalMarketingModelServiceImpl implements StuDigitalMarketingM
DescriptiveStatistics statistics=new DescriptiveStatistics();
DecimalFormat df = new DecimalFormat("#.0");
for (int i = 0; i < statistic.size(); i++) {
if(statistic.get(i).equals("平均数")){
double mean = statisticsUtil.getMean(map.get(key));
statistics.setAverage(mean);
statistics.setAverage(Double.parseDouble(df.format(mean)));
}
if(statistic.get(i).equals("中位数")){
double median = statisticsUtil.getMedian(map.get(key));
statistics.setMedian(median);
statistics.setMedian(Double.parseDouble(df.format(median)));
}
if(statistic.get(i).equals("众数")){
Double mode = statisticsUtil.getMode(map.get(key));
statistics.setMode(mode);
statistics.setMode(Double.parseDouble(df.format(mode)));
}
if(statistic.get(i).equals("标准差")){
double standardDeviation = statisticsUtil.getStandardDeviation(map.get(key));
DecimalFormat df = new DecimalFormat("#.0");
statistics.setStandardDeviation(Double.parseDouble(df.format(standardDeviation)));
}
if(statistic.get(i).equals("方差")){
double variance = statisticsUtil.getVariance(map.get(key));
statistics.setVariance(variance);
statistics.setVariance(Double.parseDouble(df.format(variance)));
}
if(statistic.get(i).equals("标准误差")){
double standardError = statisticsUtil.getStandardError(map.get(key));
statistics.setStandardError(standardError);
statistics.setStandardError(Double.parseDouble(df.format(standardError)));
}
if(statistic.get(i).equals("峰度")){
@ -217,7 +235,7 @@ public class StuDigitalMarketingModelServiceImpl implements StuDigitalMarketingM
if(Double.isNaN(kurtosis)){
statistics.setKurtosis(0);
}else {
statistics.setKurtosis(kurtosis);
statistics.setKurtosis(Double.parseDouble(df.format(kurtosis)));
}
@ -228,24 +246,24 @@ public class StuDigitalMarketingModelServiceImpl implements StuDigitalMarketingM
if(Double.isNaN(skewness)){
statistics.setSkewness(0);
}else {
statistics.setSkewness(skewness);
statistics.setSkewness(Double.parseDouble(df.format(skewness)));
}
}
if(statistic.get(i).equals("最大值")){
double max = statisticsUtil.getMax(map.get(key));
statistics.setMax(max);
statistics.setMax(Double.parseDouble(df.format(max)));
}
if(statistic.get(i).equals("最小值")){
double min = statisticsUtil.getMin(map.get(key));
statistics.setMin(min);
statistics.setMin(Double.parseDouble(df.format(min)));
}
if(statistic.get(i).equals("求和")){
double sum = statisticsUtil.getSum(map.get(key));
statistics.setSummation(sum);
statistics.setSummation(Double.parseDouble(df.format(sum)));
}
if(statistic.get(i).equals("观测数")){
@ -263,43 +281,51 @@ public class StuDigitalMarketingModelServiceImpl implements StuDigitalMarketingM
@Override
public List<String> viewMetrics(String userId, String tableName,String algorithmName) {
List<String> list=new ArrayList<>();
if(tableName.equals(Constant.YHSXB)){
if(algorithmName.equals("情感分析")){
list.add("text");
}else {
if(tableName.equals(Constant.YHSXB)){
// list=indicatorsMapper.getYHSXB();
list.add("id");
list.add("role_gender");
list.add("role_age");
}
if(tableName.equals(Constant.YHDLHYB)){
list.add("id");
list.add("role_gender");
list.add("role_age");
}
if(tableName.equals(Constant.YHDLHYB)){
// list=indicatorsMapper.getYHDLHYB();
list.add("id");
list.add("login_frequency");
list.add("login_duration");
list.add("id");
list.add("login_frequency");
list.add("login_duration");
}
if(tableName.equals(Constant.YHXFNLB)){
}
if(tableName.equals(Constant.YHXFNLB)){
// list=indicatorsMapper.getYHXFNLB();
if(algorithmName.equals("关联规则挖掘")){
list.add("consumer_goods");
} else {
list.add("id");
list.add("consumer_amount");
list.add("consumer_number");
list.add("consumer_past_seven_days_amount");
list.add("consumer_past_seven_days_number");
}
list.add("id");
list.add("consumer_amount");
list.add("consumer_number");
list.add("consumer_past_seven_days_amount");
list.add("consumer_past_seven_days_number");
}
}
if(tableName.equals(Constant.YHPLB) || tableName.equals(Constant.YHXWB)){
}
if(tableName.equals(Constant.YHPLB) || tableName.equals(Constant.YHXWB)){
// list=indicatorsMapper.getYHPLB();
if(algorithmName.equals("关联规则挖掘")){
list.add("goods_name");
}else {
list.add("id");
list.add("user_behavior_type");
}else {
list.add("id");
list.add("user_behavior_type");
}
}
}
return list;
}
@ -331,17 +357,17 @@ public class StuDigitalMarketingModelServiceImpl implements StuDigitalMarketingM
//将日期类型转为时间戳返回
for (Map<String, Object> row : attributes) {
for (Map.Entry<String, Object> entry : row.entrySet()) {
if (entry.getValue() instanceof LocalDateTime) {
LocalDateTime localDateTime = (LocalDateTime) entry.getValue();
ZonedDateTime zonedDateTime = localDateTime.atZone(ZoneId.systemDefault());
Instant instant = zonedDateTime.toInstant();
entry.setValue(instant.toEpochMilli());
}
}
}
// //将日期类型转为时间戳返回
// for (Map<String, Object> row : attributes) {
// for (Map.Entry<String, Object> entry : row.entrySet()) {
// if (entry.getValue() instanceof LocalDateTime) {
// LocalDateTime localDateTime = (LocalDateTime) entry.getValue();
// ZonedDateTime zonedDateTime = localDateTime.atZone(ZoneId.systemDefault());
// Instant instant = zonedDateTime.toInstant();
// entry.setValue(instant.toEpochMilli());
// }
// }
// }
return new ResultEntity(HttpStatus.OK,attributes);
@ -349,11 +375,20 @@ public class StuDigitalMarketingModelServiceImpl implements StuDigitalMarketingM
@Override
public ResultEntity dataPreprocessing(String userId, String method, List<Map<String, Object>> mapList) {
if(mapList.isEmpty()){
return null;
}
//数据去重
Set<String> set = new HashSet<>();
List<Map<String, Object>> deduplicatedDataList = new ArrayList<>();
for (Map<String, Object> map : mapList) {
if(map.isEmpty()){
continue;
}
String mapString = map.toString();
if (!set.contains(mapString)) {
set.add(mapString);

@ -212,7 +212,7 @@ public class Apriori {
/**
*
*/
public static List<String> connection(double min_confident) {
public static List<AssociationRulesDTO> connection(double min_confident) {
List<AssociationRulesDTO> list=new ArrayList<>();
@ -249,6 +249,9 @@ public class Apriori {
associationRulesDTO.setAssociated(item_post);
associationRulesDTO.setConfidenceLevel(confident);
String string=item_pre + "==>" + item_post+"==>" + confident;
associationRulesDTO.setRule(string);
list.add(associationRulesDTO);
@ -256,7 +259,7 @@ public class Apriori {
System.out.print(item_pre + "==>" + item_post );// 则是一个关联事件
System.out.println("==>" + confident);
String string=item_pre + "==>" + item_post+"==>" + confident;
lists.add(string);
}
@ -266,7 +269,7 @@ public class Apriori {
}
}
}
return lists;
return list;
}
public static void main(String[] args) {

@ -53,11 +53,11 @@ public class LinearRegression {
}
// 预测方法
public double predict(double[] x) {
if (x.length != this.slopes.length) {
public double predict(double[] x,double intercept,double[] slopes) {
if (x.length != slopes.length) {
throw new IllegalArgumentException("输入的x维度与模型不匹配");
}
return this.intercept + dotProduct(this.slopes, x);
return intercept + dotProduct(slopes, x);
}
// 获取截距
@ -70,29 +70,29 @@ public class LinearRegression {
return this.slopes;
}
public static void main(String[] args) {
// 示例数据
double[][] x = {{1, 19}, {1, 21}, {2, 20}, {2, 23}, {2, 31}};
double[] y = {15, 15, 16, 16, 17};
// 创建线性回归模型
LinearRegression lr = new LinearRegression();
lr.fit(x, y);
DecimalFormat df = new DecimalFormat("#.0");
List<String> list=new ArrayList<>();
for (int i = 0; i < lr.getSlopes().length; i++) {
String format = df.format(lr.getSlopes()[i]);
list.add(format);
}
// 输出模型参数
System.out.println("常数项值: " + df.format(lr.getIntercept()));
System.out.println("第一个特征系数值: " + list.get(0));
// 预测新数据
double[] newX = {2, 88};
double predictedY = lr.predict(newX);
System.out.println("输入x: " + java.util.Arrays.toString(newX) + "预测y=" + df.format(predictedY));
}
// public static void main(String[] args) {
// // 示例数据
// double[][] x = {{1, 19}, {1, 21}, {2, 20}, {2, 23}, {2, 31}};
// double[] y = {15, 15, 16, 16, 17};
//
// // 创建线性回归模型
// LinearRegression lr = new LinearRegression();
// lr.fit(x, y);
//
// DecimalFormat df = new DecimalFormat("#.0");
//
// List<String> list=new ArrayList<>();
// for (int i = 0; i < lr.getSlopes().length; i++) {
// String format = df.format(lr.getSlopes()[i]);
// list.add(format);
// }
// // 输出模型参数
// System.out.println("常数项值: " + df.format(lr.getIntercept()));
// System.out.println("第一个特征系数值: " + list.get(0));
//
// // 预测新数据
// double[] newX = {2, 88};
// double predictedY = lr.predict(newX);
// System.out.println("输入x: " + java.util.Arrays.toString(newX) + "预测y=" + df.format(predictedY));
// }
}

@ -41,12 +41,12 @@ public class LogisticRegression {
}
// 预测函数
public double predict(double x) {
public double predict(double x,double slopes,double intercept) {
BigDecimalUtils bigDecimalUtils=new BigDecimalUtils();
Double mul = bigDecimalUtils.mul(this.theta0, x);
Double mul = bigDecimalUtils.mul(intercept, x);
return bigDecimalUtils.add(this.theta1, mul);
return bigDecimalUtils.add(slopes, mul);
}
@ -57,14 +57,14 @@ public class LogisticRegression {
}
return result;
}
// 梯度下降更新参数
public void updateParameters(double x, double y) {
double h = predict(x);
double error = y - h;
theta1 += learningRate * error * h * (1 - h) * x;
theta0 += learningRate * error * h * (1 - h);
}
//
// // 梯度下降更新参数
// public void updateParameters(double x, double y) {
// double h = predict(x);
// double error = y - h;
// theta1 += learningRate * error * h * (1 - h) * x;
// theta0 += learningRate * error * h * (1 - h);
// }
private double exponentialDecayLearningRate(double currentEpoch, int totalEpochs) {
return learningRate * Math.exp(-(currentEpoch / totalEpochs));
}
@ -96,26 +96,26 @@ public class LogisticRegression {
return loss / data.length;
}
public static void main(String[] args) {
LogisticRegression model = new LogisticRegression(0.1); // 创建一个逻辑回归模型实例
double[][] data = {{1}, {2}, {3}, {4}, {5}};
double[] labels = {0, 0, 1, 1, 1}; // 假设这是一个二分类问题
// public static void main(String[] args) {
// LogisticRegression model = new LogisticRegression(0.1); // 创建一个逻辑回归模型实例
//
//// double[][] data = {{1}, {2}, {3}, {4}, {5}};
//// double[] labels = {0, 0, 1, 1, 1}; // 假设这是一个二分类问题
//
// double[][] data = {{1, 19}, {1, 21}, {2, 20}, {2, 23}, {2, 31}};
// double[] labels = {15, 15, 16, 16, 17};
model.train(data, labels, 1000); // 训练模型
DecimalFormat df = new DecimalFormat("#.0");
// 获取并打印截距项和系数
double intercept = model.getIntercept();
double coefficient = model.getCoefficient();
System.out.println("常数项值: " + df.format(intercept));
System.out.println("系数值 " + df.format(coefficient));
double prediction = model.predict(2);
System.out.println("x=3.5的预测: " + df.format(prediction));
}
//
// model.train(data, labels, 1000); // 训练模型
//
// DecimalFormat df = new DecimalFormat("#.0");
//
// // 获取并打印截距项和系数
// double intercept = model.getIntercept();
// double coefficient = model.getCoefficient();
// System.out.println("常数项值: " + df.format(intercept));
// System.out.println("系数值 " + df.format(coefficient));
//
// double prediction = model.predict(2);
// System.out.println("x=3.5的预测: " + df.format(prediction));
// }
}

@ -18,6 +18,9 @@
<result column="backups" jdbcType="VARCHAR" property="backups" />
<result column="location" jdbcType="VARCHAR" property="location" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.sztzjy.marketing.entity.StuUserAttribute">
<result column="text" jdbcType="LONGVARCHAR" property="text" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
@ -80,6 +83,25 @@
id, user_id, login_name, user_name, student_id, stu_class, major, school, role_name,
role_gender, create_time, role_age, update_time, backups, location
</sql>
<sql id="Blob_Column_List">
text
</sql>
<select id="selectByExampleWithBLOBs" parameterType="com.sztzjy.marketing.entity.StuUserAttributeExample" resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from stu_user_attribute
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExample" parameterType="com.sztzjy.marketing.entity.StuUserAttributeExample" resultMap="BaseResultMap">
select
<if test="distinct">
@ -94,9 +116,11 @@
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from stu_user_attribute
where id = #{id,jdbcType=INTEGER}
</select>
@ -115,14 +139,14 @@
user_name, student_id, stu_class,
major, school, role_name,
role_gender, create_time, role_age,
update_time, backups, location
)
update_time, backups, location,
text)
values (#{id,jdbcType=INTEGER}, #{userId,jdbcType=VARCHAR}, #{loginName,jdbcType=VARCHAR},
#{userName,jdbcType=VARCHAR}, #{studentId,jdbcType=VARCHAR}, #{stuClass,jdbcType=VARCHAR},
#{major,jdbcType=VARCHAR}, #{school,jdbcType=VARCHAR}, #{roleName,jdbcType=VARCHAR},
#{roleGender,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{roleAge,jdbcType=INTEGER},
#{updateTime,jdbcType=TIMESTAMP}, #{backups,jdbcType=VARCHAR}, #{location,jdbcType=VARCHAR}
)
#{updateTime,jdbcType=TIMESTAMP}, #{backups,jdbcType=VARCHAR}, #{location,jdbcType=VARCHAR},
#{text,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.marketing.entity.StuUserAttribute">
insert into stu_user_attribute
@ -172,6 +196,9 @@
<if test="location != null">
location,
</if>
<if test="text != null">
text,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -219,6 +246,9 @@
<if test="location != null">
#{location,jdbcType=VARCHAR},
</if>
<if test="text != null">
#{text,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.marketing.entity.StuUserAttributeExample" resultType="java.lang.Long">
@ -275,11 +305,36 @@
<if test="record.location != null">
location = #{record.location,jdbcType=VARCHAR},
</if>
<if test="record.text != null">
text = #{record.text,jdbcType=LONGVARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
update stu_user_attribute
set id = #{record.id,jdbcType=INTEGER},
user_id = #{record.userId,jdbcType=VARCHAR},
login_name = #{record.loginName,jdbcType=VARCHAR},
user_name = #{record.userName,jdbcType=VARCHAR},
student_id = #{record.studentId,jdbcType=VARCHAR},
stu_class = #{record.stuClass,jdbcType=VARCHAR},
major = #{record.major,jdbcType=VARCHAR},
school = #{record.school,jdbcType=VARCHAR},
role_name = #{record.roleName,jdbcType=VARCHAR},
role_gender = #{record.roleGender,jdbcType=INTEGER},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
role_age = #{record.roleAge,jdbcType=INTEGER},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
backups = #{record.backups,jdbcType=VARCHAR},
location = #{record.location,jdbcType=VARCHAR},
text = #{record.text,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update stu_user_attribute
set id = #{record.id,jdbcType=INTEGER},
@ -346,9 +401,31 @@
<if test="location != null">
location = #{location,jdbcType=VARCHAR},
</if>
<if test="text != null">
text = #{text,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.sztzjy.marketing.entity.StuUserAttribute">
update stu_user_attribute
set user_id = #{userId,jdbcType=VARCHAR},
login_name = #{loginName,jdbcType=VARCHAR},
user_name = #{userName,jdbcType=VARCHAR},
student_id = #{studentId,jdbcType=VARCHAR},
stu_class = #{stuClass,jdbcType=VARCHAR},
major = #{major,jdbcType=VARCHAR},
school = #{school,jdbcType=VARCHAR},
role_name = #{roleName,jdbcType=VARCHAR},
role_gender = #{roleGender,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
role_age = #{roleAge,jdbcType=INTEGER},
update_time = #{updateTime,jdbcType=TIMESTAMP},
backups = #{backups,jdbcType=VARCHAR},
location = #{location,jdbcType=VARCHAR},
text = #{text,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.marketing.entity.StuUserAttribute">
update stu_user_attribute
set user_id = #{userId,jdbcType=VARCHAR},
@ -367,11 +444,4 @@
location = #{location,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectByFields" resultType="java.util.Map">
SELECT
<foreach collection="fieldList" item="field" separator=",">
${field}
</foreach>
FROM ${table}
</select>
</mapper>

@ -14,11 +14,14 @@
<result column="goods_name" jdbcType="VARCHAR" property="goodsName" />
<result column="goods_type" jdbcType="VARCHAR" property="goodsType" />
<result column="goods_subcategories" jdbcType="VARCHAR" property="goodsSubcategories" />
<result column="user_behavior_type" jdbcType="VARCHAR" property="userBehaviorType" />
<result column="user_behavior_type" jdbcType="INTEGER" property="userBehaviorType" />
<result column="behavior_date" jdbcType="TIMESTAMP" property="behaviorDate" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.sztzjy.marketing.entity.StuUserBehavior">
<result column="text" jdbcType="LONGVARCHAR" property="text" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
@ -82,6 +85,25 @@
goods_name, goods_type, goods_subcategories, user_behavior_type, behavior_date, create_time,
update_time
</sql>
<sql id="Blob_Column_List">
text
</sql>
<select id="selectByExampleWithBLOBs" parameterType="com.sztzjy.marketing.entity.StuUserBehaviorExample" resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from stu_user_behavior
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExample" parameterType="com.sztzjy.marketing.entity.StuUserBehaviorExample" resultMap="BaseResultMap">
select
<if test="distinct">
@ -96,9 +118,11 @@
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from stu_user_behavior
where id = #{id,jdbcType=INTEGER}
</select>
@ -118,13 +142,13 @@
major, school, role_name,
goods_name, goods_type, goods_subcategories,
user_behavior_type, behavior_date, create_time,
update_time)
update_time, text)
values (#{id,jdbcType=INTEGER}, #{userId,jdbcType=VARCHAR}, #{loginName,jdbcType=VARCHAR},
#{userName,jdbcType=VARCHAR}, #{studentId,jdbcType=VARCHAR}, #{stuClass,jdbcType=VARCHAR},
#{major,jdbcType=VARCHAR}, #{school,jdbcType=VARCHAR}, #{roleName,jdbcType=VARCHAR},
#{goodsName,jdbcType=VARCHAR}, #{goodsType,jdbcType=VARCHAR}, #{goodsSubcategories,jdbcType=VARCHAR},
#{userBehaviorType,jdbcType=VARCHAR}, #{behaviorDate,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP})
#{userBehaviorType,jdbcType=INTEGER}, #{behaviorDate,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{text,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.marketing.entity.StuUserBehavior">
insert into stu_user_behavior
@ -177,6 +201,9 @@
<if test="updateTime != null">
update_time,
</if>
<if test="text != null">
text,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -216,7 +243,7 @@
#{goodsSubcategories,jdbcType=VARCHAR},
</if>
<if test="userBehaviorType != null">
#{userBehaviorType,jdbcType=VARCHAR},
#{userBehaviorType,jdbcType=INTEGER},
</if>
<if test="behaviorDate != null">
#{behaviorDate,jdbcType=TIMESTAMP},
@ -227,6 +254,9 @@
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="text != null">
#{text,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.marketing.entity.StuUserBehaviorExample" resultType="java.lang.Long">
@ -275,7 +305,7 @@
goods_subcategories = #{record.goodsSubcategories,jdbcType=VARCHAR},
</if>
<if test="record.userBehaviorType != null">
user_behavior_type = #{record.userBehaviorType,jdbcType=VARCHAR},
user_behavior_type = #{record.userBehaviorType,jdbcType=INTEGER},
</if>
<if test="record.behaviorDate != null">
behavior_date = #{record.behaviorDate,jdbcType=TIMESTAMP},
@ -286,11 +316,37 @@
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
<if test="record.text != null">
text = #{record.text,jdbcType=LONGVARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
update stu_user_behavior
set id = #{record.id,jdbcType=INTEGER},
user_id = #{record.userId,jdbcType=VARCHAR},
login_name = #{record.loginName,jdbcType=VARCHAR},
user_name = #{record.userName,jdbcType=VARCHAR},
student_id = #{record.studentId,jdbcType=VARCHAR},
stu_class = #{record.stuClass,jdbcType=VARCHAR},
major = #{record.major,jdbcType=VARCHAR},
school = #{record.school,jdbcType=VARCHAR},
role_name = #{record.roleName,jdbcType=VARCHAR},
goods_name = #{record.goodsName,jdbcType=VARCHAR},
goods_type = #{record.goodsType,jdbcType=VARCHAR},
goods_subcategories = #{record.goodsSubcategories,jdbcType=VARCHAR},
user_behavior_type = #{record.userBehaviorType,jdbcType=INTEGER},
behavior_date = #{record.behaviorDate,jdbcType=TIMESTAMP},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
text = #{record.text,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update stu_user_behavior
set id = #{record.id,jdbcType=INTEGER},
@ -305,7 +361,7 @@
goods_name = #{record.goodsName,jdbcType=VARCHAR},
goods_type = #{record.goodsType,jdbcType=VARCHAR},
goods_subcategories = #{record.goodsSubcategories,jdbcType=VARCHAR},
user_behavior_type = #{record.userBehaviorType,jdbcType=VARCHAR},
user_behavior_type = #{record.userBehaviorType,jdbcType=INTEGER},
behavior_date = #{record.behaviorDate,jdbcType=TIMESTAMP},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP}
@ -350,7 +406,7 @@
goods_subcategories = #{goodsSubcategories,jdbcType=VARCHAR},
</if>
<if test="userBehaviorType != null">
user_behavior_type = #{userBehaviorType,jdbcType=VARCHAR},
user_behavior_type = #{userBehaviorType,jdbcType=INTEGER},
</if>
<if test="behaviorDate != null">
behavior_date = #{behaviorDate,jdbcType=TIMESTAMP},
@ -361,9 +417,32 @@
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="text != null">
text = #{text,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.sztzjy.marketing.entity.StuUserBehavior">
update stu_user_behavior
set user_id = #{userId,jdbcType=VARCHAR},
login_name = #{loginName,jdbcType=VARCHAR},
user_name = #{userName,jdbcType=VARCHAR},
student_id = #{studentId,jdbcType=VARCHAR},
stu_class = #{stuClass,jdbcType=VARCHAR},
major = #{major,jdbcType=VARCHAR},
school = #{school,jdbcType=VARCHAR},
role_name = #{roleName,jdbcType=VARCHAR},
goods_name = #{goodsName,jdbcType=VARCHAR},
goods_type = #{goodsType,jdbcType=VARCHAR},
goods_subcategories = #{goodsSubcategories,jdbcType=VARCHAR},
user_behavior_type = #{userBehaviorType,jdbcType=INTEGER},
behavior_date = #{behaviorDate,jdbcType=TIMESTAMP},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
text = #{text,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.marketing.entity.StuUserBehavior">
update stu_user_behavior
set user_id = #{userId,jdbcType=VARCHAR},
@ -377,7 +456,7 @@
goods_name = #{goodsName,jdbcType=VARCHAR},
goods_type = #{goodsType,jdbcType=VARCHAR},
goods_subcategories = #{goodsSubcategories,jdbcType=VARCHAR},
user_behavior_type = #{userBehaviorType,jdbcType=VARCHAR},
user_behavior_type = #{userBehaviorType,jdbcType=INTEGER},
behavior_date = #{behaviorDate,jdbcType=TIMESTAMP},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}

@ -21,6 +21,9 @@
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.sztzjy.marketing.entity.StuUserConsumptionAbility">
<result column="text" jdbcType="LONGVARCHAR" property="text" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
@ -84,6 +87,25 @@
consumer_goods, consumer_goods_type, consumer_amount, consumer_number, consumer_past_seven_days_amount,
consumer_past_seven_days_number, recent_consumption_time, create_time, update_time
</sql>
<sql id="Blob_Column_List">
text
</sql>
<select id="selectByExampleWithBLOBs" parameterType="com.sztzjy.marketing.entity.StuUserConsumptionAbilityExample" resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from stu_user_consumption_ability
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExample" parameterType="com.sztzjy.marketing.entity.StuUserConsumptionAbilityExample" resultMap="BaseResultMap">
select
<if test="distinct">
@ -98,9 +120,11 @@
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from stu_user_consumption_ability
where id = #{id,jdbcType=INTEGER}
</select>
@ -121,14 +145,16 @@
consumer_goods, consumer_goods_type, consumer_amount,
consumer_number, consumer_past_seven_days_amount,
consumer_past_seven_days_number, recent_consumption_time,
create_time, update_time)
create_time, update_time, text
)
values (#{id,jdbcType=INTEGER}, #{userId,jdbcType=VARCHAR}, #{loginName,jdbcType=VARCHAR},
#{userName,jdbcType=VARCHAR}, #{studentId,jdbcType=VARCHAR}, #{stuClass,jdbcType=VARCHAR},
#{major,jdbcType=VARCHAR}, #{school,jdbcType=VARCHAR}, #{roleName,jdbcType=VARCHAR},
#{consumerGoods,jdbcType=VARCHAR}, #{consumerGoodsType,jdbcType=VARCHAR}, #{consumerAmount,jdbcType=DECIMAL},
#{consumerNumber,jdbcType=INTEGER}, #{consumerPastSevenDaysAmount,jdbcType=DECIMAL},
#{consumerPastSevenDaysNumber,jdbcType=INTEGER}, #{recentConsumptionTime,jdbcType=TIMESTAMP},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{text,jdbcType=LONGVARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.marketing.entity.StuUserConsumptionAbility">
insert into stu_user_consumption_ability
@ -187,6 +213,9 @@
<if test="updateTime != null">
update_time,
</if>
<if test="text != null">
text,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -243,6 +272,9 @@
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="text != null">
#{text,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.marketing.entity.StuUserConsumptionAbilityExample" resultType="java.lang.Long">
@ -251,8 +283,7 @@
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
<update id="updateByExampleSelective" parameterType="map">
update stu_user_consumption_ability
<set>
<if test="record.id != null">
@ -309,11 +340,39 @@
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
<if test="record.text != null">
text = #{record.text,jdbcType=LONGVARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
update stu_user_consumption_ability
set id = #{record.id,jdbcType=INTEGER},
user_id = #{record.userId,jdbcType=VARCHAR},
login_name = #{record.loginName,jdbcType=VARCHAR},
user_name = #{record.userName,jdbcType=VARCHAR},
student_id = #{record.studentId,jdbcType=VARCHAR},
stu_class = #{record.stuClass,jdbcType=VARCHAR},
major = #{record.major,jdbcType=VARCHAR},
school = #{record.school,jdbcType=VARCHAR},
role_name = #{record.roleName,jdbcType=VARCHAR},
consumer_goods = #{record.consumerGoods,jdbcType=VARCHAR},
consumer_goods_type = #{record.consumerGoodsType,jdbcType=VARCHAR},
consumer_amount = #{record.consumerAmount,jdbcType=DECIMAL},
consumer_number = #{record.consumerNumber,jdbcType=INTEGER},
consumer_past_seven_days_amount = #{record.consumerPastSevenDaysAmount,jdbcType=DECIMAL},
consumer_past_seven_days_number = #{record.consumerPastSevenDaysNumber,jdbcType=INTEGER},
recent_consumption_time = #{record.recentConsumptionTime,jdbcType=TIMESTAMP},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
text = #{record.text,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update stu_user_consumption_ability
set id = #{record.id,jdbcType=INTEGER},
@ -392,9 +451,34 @@
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="text != null">
text = #{text,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.sztzjy.marketing.entity.StuUserConsumptionAbility">
update stu_user_consumption_ability
set user_id = #{userId,jdbcType=VARCHAR},
login_name = #{loginName,jdbcType=VARCHAR},
user_name = #{userName,jdbcType=VARCHAR},
student_id = #{studentId,jdbcType=VARCHAR},
stu_class = #{stuClass,jdbcType=VARCHAR},
major = #{major,jdbcType=VARCHAR},
school = #{school,jdbcType=VARCHAR},
role_name = #{roleName,jdbcType=VARCHAR},
consumer_goods = #{consumerGoods,jdbcType=VARCHAR},
consumer_goods_type = #{consumerGoodsType,jdbcType=VARCHAR},
consumer_amount = #{consumerAmount,jdbcType=DECIMAL},
consumer_number = #{consumerNumber,jdbcType=INTEGER},
consumer_past_seven_days_amount = #{consumerPastSevenDaysAmount,jdbcType=DECIMAL},
consumer_past_seven_days_number = #{consumerPastSevenDaysNumber,jdbcType=INTEGER},
recent_consumption_time = #{recentConsumptionTime,jdbcType=TIMESTAMP},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
text = #{text,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.marketing.entity.StuUserConsumptionAbility">
update stu_user_consumption_ability
set user_id = #{userId,jdbcType=VARCHAR},
@ -416,11 +500,4 @@
update_time = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectByFields" resultType="com.sztzjy.marketing.entity.StuUserConsumptionAbility" resultMap="BaseResultMap">
SELECT
<foreach collection="fieldList" item="field" separator=",">
${field}
</foreach>
FROM ${table}
</select>
</mapper>

@ -18,6 +18,9 @@
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.sztzjy.marketing.entity.StuUserLoginActive">
<result column="text" jdbcType="LONGVARCHAR" property="text" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
@ -81,6 +84,25 @@
frequent_login_location, last_login_date, login_frequency, login_duration, create_time,
update_time
</sql>
<sql id="Blob_Column_List">
text
</sql>
<select id="selectByExampleWithBLOBs" parameterType="com.sztzjy.marketing.entity.StuUserLoginActiveExample" resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from stu_user_login_active
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExample" parameterType="com.sztzjy.marketing.entity.StuUserLoginActiveExample" resultMap="BaseResultMap">
select
<if test="distinct">
@ -95,9 +117,11 @@
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from stu_user_login_active
where id = #{id,jdbcType=INTEGER}
</select>
@ -117,13 +141,13 @@
major, school, role_name,
frequent_login_location, last_login_date,
login_frequency, login_duration, create_time,
update_time)
update_time, text)
values (#{id,jdbcType=INTEGER}, #{userId,jdbcType=VARCHAR}, #{loginName,jdbcType=VARCHAR},
#{userName,jdbcType=VARCHAR}, #{studentId,jdbcType=VARCHAR}, #{stuClass,jdbcType=VARCHAR},
#{major,jdbcType=VARCHAR}, #{school,jdbcType=VARCHAR}, #{roleName,jdbcType=VARCHAR},
#{frequentLoginLocation,jdbcType=VARCHAR}, #{lastLoginDate,jdbcType=TIMESTAMP},
#{loginFrequency,jdbcType=INTEGER}, #{loginDuration,jdbcType=DOUBLE}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP})
#{updateTime,jdbcType=TIMESTAMP}, #{text,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.marketing.entity.StuUserLoginActive">
insert into stu_user_login_active
@ -173,6 +197,9 @@
<if test="updateTime != null">
update_time,
</if>
<if test="text != null">
text,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -220,6 +247,9 @@
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="text != null">
#{text,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.marketing.entity.StuUserLoginActiveExample" resultType="java.lang.Long">
@ -276,11 +306,36 @@
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
<if test="record.text != null">
text = #{record.text,jdbcType=LONGVARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
update stu_user_login_active
set id = #{record.id,jdbcType=INTEGER},
user_id = #{record.userId,jdbcType=VARCHAR},
login_name = #{record.loginName,jdbcType=VARCHAR},
user_name = #{record.userName,jdbcType=VARCHAR},
student_id = #{record.studentId,jdbcType=VARCHAR},
stu_class = #{record.stuClass,jdbcType=VARCHAR},
major = #{record.major,jdbcType=VARCHAR},
school = #{record.school,jdbcType=VARCHAR},
role_name = #{record.roleName,jdbcType=VARCHAR},
frequent_login_location = #{record.frequentLoginLocation,jdbcType=VARCHAR},
last_login_date = #{record.lastLoginDate,jdbcType=TIMESTAMP},
login_frequency = #{record.loginFrequency,jdbcType=INTEGER},
login_duration = #{record.loginDuration,jdbcType=DOUBLE},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
text = #{record.text,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update stu_user_login_active
set id = #{record.id,jdbcType=INTEGER},
@ -347,9 +402,31 @@
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="text != null">
text = #{text,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.sztzjy.marketing.entity.StuUserLoginActive">
update stu_user_login_active
set user_id = #{userId,jdbcType=VARCHAR},
login_name = #{loginName,jdbcType=VARCHAR},
user_name = #{userName,jdbcType=VARCHAR},
student_id = #{studentId,jdbcType=VARCHAR},
stu_class = #{stuClass,jdbcType=VARCHAR},
major = #{major,jdbcType=VARCHAR},
school = #{school,jdbcType=VARCHAR},
role_name = #{roleName,jdbcType=VARCHAR},
frequent_login_location = #{frequentLoginLocation,jdbcType=VARCHAR},
last_login_date = #{lastLoginDate,jdbcType=TIMESTAMP},
login_frequency = #{loginFrequency,jdbcType=INTEGER},
login_duration = #{loginDuration,jdbcType=DOUBLE},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
text = #{text,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.marketing.entity.StuUserLoginActive">
update stu_user_login_active
set user_id = #{userId,jdbcType=VARCHAR},

Loading…
Cancel
Save