Merge branch 'master' of http://118.31.7.2:3000/tzjy-code/digital_marketing
commit
fb19497842
@ -0,0 +1,66 @@
|
||||
package com.sztzjy.marketing.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
/**
|
||||
*
|
||||
* @author whb
|
||||
* stu_table_name
|
||||
*/
|
||||
public class StuTableName {
|
||||
@ApiModelProperty("ID")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty("用户ID")
|
||||
private String userId;
|
||||
|
||||
@ApiModelProperty("表格名")
|
||||
private String tableName;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty("更新时间")
|
||||
private Date updateTime;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId == null ? null : userId.trim();
|
||||
}
|
||||
|
||||
public String getTableName() {
|
||||
return tableName;
|
||||
}
|
||||
|
||||
public void setTableName(String tableName) {
|
||||
this.tableName = tableName == null ? null : tableName.trim();
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public Date getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(Date updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
}
|
@ -0,0 +1,520 @@
|
||||
package com.sztzjy.marketing.entity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class StuTableNameExample {
|
||||
protected String orderByClause;
|
||||
|
||||
protected boolean distinct;
|
||||
|
||||
protected List<Criteria> oredCriteria;
|
||||
|
||||
public StuTableNameExample() {
|
||||
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 andIdIsNull() {
|
||||
addCriterion("id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIsNotNull() {
|
||||
addCriterion("id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdEqualTo(Integer value) {
|
||||
addCriterion("id =", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotEqualTo(Integer value) {
|
||||
addCriterion("id <>", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThan(Integer value) {
|
||||
addCriterion("id >", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
|
||||
addCriterion("id >=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThan(Integer value) {
|
||||
addCriterion("id <", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThanOrEqualTo(Integer value) {
|
||||
addCriterion("id <=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIn(List<Integer> values) {
|
||||
addCriterion("id in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotIn(List<Integer> values) {
|
||||
addCriterion("id not in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdBetween(Integer value1, Integer value2) {
|
||||
addCriterion("id between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotBetween(Integer value1, Integer value2) {
|
||||
addCriterion("id not between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdIsNull() {
|
||||
addCriterion("user_id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdIsNotNull() {
|
||||
addCriterion("user_id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdEqualTo(String value) {
|
||||
addCriterion("user_id =", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdNotEqualTo(String value) {
|
||||
addCriterion("user_id <>", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdGreaterThan(String value) {
|
||||
addCriterion("user_id >", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("user_id >=", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdLessThan(String value) {
|
||||
addCriterion("user_id <", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdLessThanOrEqualTo(String value) {
|
||||
addCriterion("user_id <=", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdLike(String value) {
|
||||
addCriterion("user_id like", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdNotLike(String value) {
|
||||
addCriterion("user_id not like", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdIn(List<String> values) {
|
||||
addCriterion("user_id in", values, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdNotIn(List<String> values) {
|
||||
addCriterion("user_id not in", values, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdBetween(String value1, String value2) {
|
||||
addCriterion("user_id between", value1, value2, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdNotBetween(String value1, String value2) {
|
||||
addCriterion("user_id not between", value1, value2, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTableNameIsNull() {
|
||||
addCriterion("table_name is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTableNameIsNotNull() {
|
||||
addCriterion("table_name is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTableNameEqualTo(String value) {
|
||||
addCriterion("table_name =", value, "tableName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTableNameNotEqualTo(String value) {
|
||||
addCriterion("table_name <>", value, "tableName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTableNameGreaterThan(String value) {
|
||||
addCriterion("table_name >", value, "tableName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTableNameGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("table_name >=", value, "tableName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTableNameLessThan(String value) {
|
||||
addCriterion("table_name <", value, "tableName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTableNameLessThanOrEqualTo(String value) {
|
||||
addCriterion("table_name <=", value, "tableName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTableNameLike(String value) {
|
||||
addCriterion("table_name like", value, "tableName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTableNameNotLike(String value) {
|
||||
addCriterion("table_name not like", value, "tableName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTableNameIn(List<String> values) {
|
||||
addCriterion("table_name in", values, "tableName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTableNameNotIn(List<String> values) {
|
||||
addCriterion("table_name not in", values, "tableName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTableNameBetween(String value1, String value2) {
|
||||
addCriterion("table_name between", value1, value2, "tableName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTableNameNotBetween(String value1, String value2) {
|
||||
addCriterion("table_name not between", value1, value2, "tableName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeIsNull() {
|
||||
addCriterion("create_time is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeIsNotNull() {
|
||||
addCriterion("create_time is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeEqualTo(Date value) {
|
||||
addCriterion("create_time =", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeNotEqualTo(Date value) {
|
||||
addCriterion("create_time <>", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeGreaterThan(Date value) {
|
||||
addCriterion("create_time >", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
|
||||
addCriterion("create_time >=", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeLessThan(Date value) {
|
||||
addCriterion("create_time <", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
|
||||
addCriterion("create_time <=", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeIn(List<Date> values) {
|
||||
addCriterion("create_time in", values, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeNotIn(List<Date> values) {
|
||||
addCriterion("create_time not in", values, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeBetween(Date value1, Date value2) {
|
||||
addCriterion("create_time between", value1, value2, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
|
||||
addCriterion("create_time not between", value1, value2, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeIsNull() {
|
||||
addCriterion("update_time is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeIsNotNull() {
|
||||
addCriterion("update_time is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeEqualTo(Date value) {
|
||||
addCriterion("update_time =", value, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeNotEqualTo(Date value) {
|
||||
addCriterion("update_time <>", value, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeGreaterThan(Date value) {
|
||||
addCriterion("update_time >", value, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) {
|
||||
addCriterion("update_time >=", value, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeLessThan(Date value) {
|
||||
addCriterion("update_time <", value, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeLessThanOrEqualTo(Date value) {
|
||||
addCriterion("update_time <=", value, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeIn(List<Date> values) {
|
||||
addCriterion("update_time in", values, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeNotIn(List<Date> values) {
|
||||
addCriterion("update_time not in", values, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeBetween(Date value1, Date value2) {
|
||||
addCriterion("update_time between", value1, value2, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeNotBetween(Date value1, Date value2) {
|
||||
addCriterion("update_time not between", value1, value2, "updateTime");
|
||||
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,188 @@
|
||||
package com.sztzjy.marketing.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
/**
|
||||
* 用户行为表
|
||||
*
|
||||
* @author whb
|
||||
* stu_user_behavior
|
||||
*/
|
||||
public class StuUserBehavior {
|
||||
@ApiModelProperty("id")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty("用户ID")
|
||||
private String userId;
|
||||
|
||||
@ApiModelProperty("登录名")
|
||||
private String loginName;
|
||||
|
||||
@ApiModelProperty("用户名")
|
||||
private String userName;
|
||||
|
||||
@ApiModelProperty("学号")
|
||||
private String studentId;
|
||||
|
||||
@ApiModelProperty("班级")
|
||||
private String stuClass;
|
||||
|
||||
@ApiModelProperty("专业")
|
||||
private String major;
|
||||
|
||||
@ApiModelProperty("学校")
|
||||
private String school;
|
||||
|
||||
@ApiModelProperty("角色名称")
|
||||
private String roleName;
|
||||
|
||||
@ApiModelProperty("商品名字")
|
||||
private String goodsName;
|
||||
|
||||
@ApiModelProperty("商品类型")
|
||||
private String goodsType;
|
||||
|
||||
@ApiModelProperty("商品小类")
|
||||
private String goodsSubcategories;
|
||||
|
||||
@ApiModelProperty("用户行为类型")
|
||||
private String userBehaviorType;
|
||||
|
||||
@ApiModelProperty("行为日期")
|
||||
private Date behaviorDate;
|
||||
|
||||
@ApiModelProperty("创建时间(注册时间)")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty("更新时间")
|
||||
private Date updateTime;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId == null ? null : userId.trim();
|
||||
}
|
||||
|
||||
public String getLoginName() {
|
||||
return loginName;
|
||||
}
|
||||
|
||||
public void setLoginName(String loginName) {
|
||||
this.loginName = loginName == null ? null : loginName.trim();
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName == null ? null : userName.trim();
|
||||
}
|
||||
|
||||
public String getStudentId() {
|
||||
return studentId;
|
||||
}
|
||||
|
||||
public void setStudentId(String studentId) {
|
||||
this.studentId = studentId == null ? null : studentId.trim();
|
||||
}
|
||||
|
||||
public String getStuClass() {
|
||||
return stuClass;
|
||||
}
|
||||
|
||||
public void setStuClass(String stuClass) {
|
||||
this.stuClass = stuClass == null ? null : stuClass.trim();
|
||||
}
|
||||
|
||||
public String getMajor() {
|
||||
return major;
|
||||
}
|
||||
|
||||
public void setMajor(String major) {
|
||||
this.major = major == null ? null : major.trim();
|
||||
}
|
||||
|
||||
public String getSchool() {
|
||||
return school;
|
||||
}
|
||||
|
||||
public void setSchool(String school) {
|
||||
this.school = school == null ? null : school.trim();
|
||||
}
|
||||
|
||||
public String getRoleName() {
|
||||
return roleName;
|
||||
}
|
||||
|
||||
public void setRoleName(String roleName) {
|
||||
this.roleName = roleName == null ? null : roleName.trim();
|
||||
}
|
||||
|
||||
public String getGoodsName() {
|
||||
return goodsName;
|
||||
}
|
||||
|
||||
public void setGoodsName(String goodsName) {
|
||||
this.goodsName = goodsName == null ? null : goodsName.trim();
|
||||
}
|
||||
|
||||
public String getGoodsType() {
|
||||
return goodsType;
|
||||
}
|
||||
|
||||
public void setGoodsType(String goodsType) {
|
||||
this.goodsType = goodsType == null ? null : goodsType.trim();
|
||||
}
|
||||
|
||||
public String getGoodsSubcategories() {
|
||||
return goodsSubcategories;
|
||||
}
|
||||
|
||||
public void setGoodsSubcategories(String goodsSubcategories) {
|
||||
this.goodsSubcategories = goodsSubcategories == null ? null : goodsSubcategories.trim();
|
||||
}
|
||||
|
||||
public String getUserBehaviorType() {
|
||||
return userBehaviorType;
|
||||
}
|
||||
|
||||
public void setUserBehaviorType(String userBehaviorType) {
|
||||
this.userBehaviorType = userBehaviorType == null ? null : userBehaviorType.trim();
|
||||
}
|
||||
|
||||
public Date getBehaviorDate() {
|
||||
return behaviorDate;
|
||||
}
|
||||
|
||||
public void setBehaviorDate(Date behaviorDate) {
|
||||
this.behaviorDate = behaviorDate;
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public Date getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(Date updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -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/6/20 8:51
|
||||
*/
|
||||
@Data
|
||||
public class AssociationRulesDTO {
|
||||
@ApiModelProperty("关联")
|
||||
private List<String> correlation;
|
||||
|
||||
@ApiModelProperty("被关联")
|
||||
private List<String> associated;
|
||||
|
||||
@ApiModelProperty("置信度")
|
||||
private double confidenceLevel;
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.sztzjy.marketing.entity.dto;
|
||||
|
||||
import com.sztzjy.marketing.util.algorithm.KMeans;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author tz
|
||||
* @date 2024/6/14 10:12
|
||||
*/
|
||||
@Data
|
||||
public class ClusterAnalysisDTO {
|
||||
private Map<Integer, List<KMeans.Point>> dataSet;
|
||||
|
||||
private Map<Integer,List<KMeans.Point>> centroid;
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
package com.sztzjy.marketing.entity.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author tz
|
||||
* @date 2024/6/21 9:51
|
||||
*/
|
||||
@Data
|
||||
public class DescriptiveStatistics {
|
||||
@ApiModelProperty("平均数")
|
||||
private double average;
|
||||
|
||||
@ApiModelProperty("中位数")
|
||||
private double median;
|
||||
|
||||
@ApiModelProperty("众数")
|
||||
private List<Double> mode;
|
||||
|
||||
@ApiModelProperty("标准差")
|
||||
private double standardDeviation;
|
||||
|
||||
@ApiModelProperty("方差")
|
||||
private double variance;
|
||||
|
||||
@ApiModelProperty("标准误差")
|
||||
private double standardError;
|
||||
|
||||
@ApiModelProperty("峰度")
|
||||
private double kurtosis;
|
||||
|
||||
@ApiModelProperty("偏度")
|
||||
private double skewness;
|
||||
|
||||
@ApiModelProperty("最大值")
|
||||
private double max;
|
||||
|
||||
@ApiModelProperty("最小值")
|
||||
private double min;
|
||||
|
||||
@ApiModelProperty("求和")
|
||||
private double summation;
|
||||
|
||||
@ApiModelProperty("观测数")
|
||||
private Integer observations;
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.sztzjy.marketing.entity.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author tz
|
||||
* @date 2024/6/21 10:00
|
||||
*/
|
||||
@Data
|
||||
public class DescriptiveStatisticsDTO {
|
||||
private String field;
|
||||
|
||||
private DescriptiveStatistics statistics;
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.sztzjy.marketing.entity.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author tz
|
||||
* @date 2024/6/21 10:57
|
||||
*/
|
||||
@Data
|
||||
public class StatisticsDTO {
|
||||
private Map<String, List<Double>> map;
|
||||
private List<String> statistic;
|
||||
private String userId;
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.sztzjy.marketing.entity.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author tz
|
||||
* @date 2024/6/18 16:48
|
||||
*/
|
||||
@Data
|
||||
public class WordFrequencyDTO {
|
||||
private String keyword;
|
||||
|
||||
private Integer frequency;
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.sztzjy.marketing.mapper;
|
||||
import com.sztzjy.marketing.entity.StuUserAttribute;
|
||||
import com.sztzjy.marketing.entity.StuUserBehavior;
|
||||
import com.sztzjy.marketing.entity.StuUserConsumptionAbility;
|
||||
import com.sztzjy.marketing.entity.StuUserLoginActive;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;/**
|
||||
* @author tz
|
||||
* @date 2024/6/21 13:50
|
||||
*/
|
||||
@Mapper
|
||||
public interface StuSelectIndicatorsMapper {
|
||||
|
||||
|
||||
@Select("select COLUMN_NAME from information_schema.COLUMNS where table_name = 'stu_user_login_active'")
|
||||
|
||||
List<String> getYHDLHYB();
|
||||
|
||||
@Select("select COLUMN_NAME from information_schema.COLUMNS where table_name = 'stu_user_consumption_ability'")
|
||||
List<String> getYHXFNLB();
|
||||
|
||||
@Select("select COLUMN_NAME from information_schema.COLUMNS where table_name = 'stu_user_behavior'")
|
||||
List<String> getYHPLB();
|
||||
|
||||
@Select("select COLUMN_NAME from information_schema.COLUMNS where table_name = 'stu_user_attribute'")
|
||||
List<String> getYHSXB();
|
||||
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package com.sztzjy.marketing.mapper;
|
||||
|
||||
import com.sztzjy.marketing.entity.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@Mapper
|
||||
public interface StuTableNameMapper {
|
||||
long countByExample(StuTableNameExample example);
|
||||
|
||||
int deleteByExample(StuTableNameExample example);
|
||||
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(StuTableName record);
|
||||
|
||||
int insertSelective(StuTableName record);
|
||||
|
||||
List<StuTableName> selectByExample(StuTableNameExample example);
|
||||
|
||||
StuTableName selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByExampleSelective(@Param("record") StuTableName record, @Param("example") StuTableNameExample example);
|
||||
|
||||
int updateByExample(@Param("record") StuTableName record, @Param("example") StuTableNameExample example);
|
||||
|
||||
int updateByPrimaryKeySelective(StuTableName record);
|
||||
|
||||
int updateByPrimaryKey(StuTableName record);
|
||||
|
||||
List<String> getTableName(String userId);
|
||||
|
||||
List<Map<String,Object>> selectByFields(List<String> fieldList, String table);
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
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.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@Mapper
|
||||
public interface StuUserBehaviorMapper {
|
||||
long countByExample(StuUserBehaviorExample example);
|
||||
|
||||
int deleteByExample(StuUserBehaviorExample example);
|
||||
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(StuUserBehavior record);
|
||||
|
||||
int insertSelective(StuUserBehavior record);
|
||||
|
||||
List<StuUserBehavior> selectByExample(StuUserBehaviorExample example);
|
||||
|
||||
StuUserBehavior selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByExampleSelective(@Param("record") StuUserBehavior record, @Param("example") StuUserBehaviorExample example);
|
||||
|
||||
int updateByExample(@Param("record") StuUserBehavior record, @Param("example") StuUserBehaviorExample example);
|
||||
|
||||
int updateByPrimaryKeySelective(StuUserBehavior record);
|
||||
|
||||
int updateByPrimaryKey(StuUserBehavior record);
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.sztzjy.marketing.service;
|
||||
|
||||
import com.sztzjy.marketing.util.ResultEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author tz
|
||||
* @date 2024/6/14 11:05
|
||||
*/
|
||||
public interface StuDigitalMarketingModelService {
|
||||
List<String> dropdownBox(String userId);
|
||||
|
||||
ResultEntity emotionalAnalysis(String userId, String modelType, String content) throws IOException;
|
||||
|
||||
|
||||
ResultEntity descriptiveStatistics(Map<String, List<Double>> map, List<String> statistic, String userId);
|
||||
|
||||
List<String> viewMetrics(String userId, String tableName);
|
||||
|
||||
ResultEntity viewAnalyzeData(String userId, String tableName, List<String> fieldList);
|
||||
}
|
@ -0,0 +1,288 @@
|
||||
package com.sztzjy.marketing.service.impl;
|
||||
|
||||
import com.hankcs.hanlp.HanLP;
|
||||
import com.hankcs.hanlp.seg.common.Term;
|
||||
import com.sztzjy.marketing.config.Constant;
|
||||
import com.sztzjy.marketing.entity.*;
|
||||
import com.sztzjy.marketing.entity.dto.DescriptiveStatistics;
|
||||
import com.sztzjy.marketing.entity.dto.DescriptiveStatisticsDTO;
|
||||
import com.sztzjy.marketing.entity.dto.WordFrequencyDTO;
|
||||
import com.sztzjy.marketing.mapper.StuSelectIndicatorsMapper;
|
||||
import com.sztzjy.marketing.mapper.StuTableNameMapper;
|
||||
import com.sztzjy.marketing.service.StuDigitalMarketingModelService;
|
||||
import com.sztzjy.marketing.util.ResultEntity;
|
||||
import com.sztzjy.marketing.util.algorithm.DescriptiveStatisticsUtil;
|
||||
import okhttp3.*;
|
||||
import org.checkerframework.checker.units.qual.C;
|
||||
import org.geolatte.geom.M;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author tz
|
||||
* @date 2024/6/14 11:05
|
||||
*/
|
||||
@Service
|
||||
public class StuDigitalMarketingModelServiceImpl implements StuDigitalMarketingModelService {
|
||||
|
||||
private final OkHttpClient HTTP_CLIENT = new OkHttpClient().newBuilder().build();
|
||||
|
||||
|
||||
@Resource
|
||||
StuTableNameMapper stuTableNameMapper;
|
||||
|
||||
@Resource
|
||||
StuSelectIndicatorsMapper indicatorsMapper;
|
||||
|
||||
@Resource
|
||||
StuTableNameMapper tableNameMapper;
|
||||
@Override
|
||||
public List<String> dropdownBox(String userId) {
|
||||
|
||||
List<String> list=stuTableNameMapper.getTableName(userId);
|
||||
|
||||
if(list.isEmpty()){ //设置默认值
|
||||
String[] arr={"用户属性表","用户登录活跃表","用户消费能力表","用户行为表","用户评论表"};
|
||||
|
||||
StuTableName stuTableName=new StuTableName();
|
||||
for (int i = 0; i < arr.length; i++) {
|
||||
Integer uuid = UUID.randomUUID().toString().replaceAll("-", "").hashCode();
|
||||
uuid = uuid < 0 ? -uuid : uuid;//String.hashCode() 值会为空
|
||||
|
||||
stuTableName.setId(uuid);
|
||||
stuTableName.setTableName(arr[i]);
|
||||
stuTableName.setUserId(userId);
|
||||
stuTableName.setCreateTime(new Date());
|
||||
|
||||
stuTableNameMapper.insert(stuTableName);
|
||||
list.add(arr[i]);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultEntity emotionalAnalysis(String userId, String modelType, String content) throws IOException {
|
||||
|
||||
String commentUrl = "https://aip.baidubce.com/rpc/2.0/nlp/v2/comment_tag?access_token=24.88968c130db3ca9f266907b5004bec8f.2592000.1721270821.282335-83957582&charset=UTF-8";
|
||||
String emoUrl="https://aip.baidubce.com/rpc/2.0/nlp/v1/sentiment_classify?access_token=24.88968c130db3ca9f266907b5004bec8f.2592000.1721270821.282335-83957582";
|
||||
|
||||
|
||||
MediaType mediaType = MediaType.parse("application/json");
|
||||
|
||||
if(modelType.equals(Constant.COMMENT_EXTRACTION)){ //评论观点抽取
|
||||
|
||||
RequestBody body = RequestBody.create(mediaType, "{\"text\":\""+content+"\",\"type\":8}");
|
||||
|
||||
Request request = new Request.Builder()
|
||||
.url(commentUrl)
|
||||
.method("POST", body)
|
||||
.build();
|
||||
Response response = HTTP_CLIENT.newCall(request).execute();
|
||||
|
||||
if (response.body() != null) {
|
||||
return new ResultEntity(HttpStatus.OK,"成功",response.body().string());
|
||||
}
|
||||
|
||||
}
|
||||
if(modelType.equals(Constant.EMOTIONAL_TENDENCIES)){ //情感倾向分析
|
||||
|
||||
RequestBody body = RequestBody.create(mediaType, "{\"text\":\""+content+"\"}");
|
||||
|
||||
Request request = new Request.Builder()
|
||||
.url(emoUrl)
|
||||
.method("POST", body)
|
||||
.build();
|
||||
Response response = HTTP_CLIENT.newCall(request).execute();
|
||||
|
||||
if (response.body() != null) {
|
||||
return new ResultEntity(HttpStatus.OK,"成功",response.body().string());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
if(modelType.equals(Constant.WORD_FREQUENCY)){ //词频分析
|
||||
|
||||
// 使用 HanLP 分词
|
||||
List<Term> terms = HanLP.segment(content);
|
||||
// 创建词汇表
|
||||
Map<String, Integer> wordCount = new HashMap<>();
|
||||
// 统计词频
|
||||
|
||||
// 创建计数器
|
||||
int count = 0;
|
||||
for (Term term : terms) {
|
||||
String word = term.word.trim(); // 去除空格
|
||||
if(!word.isEmpty()){
|
||||
count++;
|
||||
if (wordCount.containsKey(word)) {
|
||||
wordCount.put(word, wordCount.get(word) + 1);
|
||||
} else {
|
||||
wordCount.put(word, 1);
|
||||
}
|
||||
}
|
||||
if (count >= 200) { // 达到200个关键词时结束统计
|
||||
break;
|
||||
}
|
||||
}
|
||||
// 将词汇表转换为列表,便于排序
|
||||
List<Map.Entry<String, Integer>> wordList = new ArrayList<>(wordCount.entrySet());
|
||||
// 按词频排序
|
||||
wordList.sort((o1, o2) -> o2.getValue().compareTo(o1.getValue()));
|
||||
|
||||
List<WordFrequencyDTO> list=new ArrayList<>();
|
||||
|
||||
for (Map.Entry<String, Integer> entry : wordList) {
|
||||
WordFrequencyDTO frequencyDTO=new WordFrequencyDTO();
|
||||
frequencyDTO.setKeyword(entry.getKey());
|
||||
frequencyDTO.setFrequency(entry.getValue());
|
||||
list.add(frequencyDTO);
|
||||
}
|
||||
return new ResultEntity<>(HttpStatus.OK,"成功",list);
|
||||
|
||||
}
|
||||
// if(modelType.equals(Constant.WORD_CLOUD)){ //词云分析
|
||||
//
|
||||
// }
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultEntity descriptiveStatistics(Map<String, List<Double>> map, List<String> statistic, String userId) {
|
||||
|
||||
DescriptiveStatisticsUtil statisticsUtil=new DescriptiveStatisticsUtil();
|
||||
|
||||
List<DescriptiveStatisticsDTO> dtoList=new ArrayList<>();
|
||||
|
||||
for(String key: map.keySet()){
|
||||
DescriptiveStatisticsDTO statisticsDTO=new DescriptiveStatisticsDTO();
|
||||
statisticsDTO.setField(key);
|
||||
|
||||
DescriptiveStatistics statistics=new DescriptiveStatistics();
|
||||
|
||||
for (int i = 0; i < statistic.size(); i++) {
|
||||
if(statistic.get(i).equals("平均数")){
|
||||
double mean = statisticsUtil.getMean(map.get(key));
|
||||
statistics.setAverage(mean);
|
||||
|
||||
}
|
||||
if(statistic.get(i).equals("中位数")){
|
||||
double median = statisticsUtil.getMedian(map.get(key));
|
||||
statistics.setMedian(median);
|
||||
|
||||
}
|
||||
if(statistic.get(i).equals("众数")){
|
||||
List<Double> mode = statisticsUtil.getMode(map.get(key));
|
||||
statistics.setMode(mode);
|
||||
|
||||
}
|
||||
if(statistic.get(i).equals("标准差")){
|
||||
double standardDeviation = statisticsUtil.getStandardDeviation(map.get(key));
|
||||
statistics.setStandardDeviation(standardDeviation);
|
||||
|
||||
}
|
||||
if(statistic.get(i).equals("方差")){
|
||||
double variance = statisticsUtil.getVariance(map.get(key));
|
||||
statistics.setVariance(variance);
|
||||
|
||||
}
|
||||
if(statistic.get(i).equals("标准误差")){
|
||||
double standardError = statisticsUtil.getStandardError(map.get(key));
|
||||
statistics.setStandardError(standardError);
|
||||
|
||||
}
|
||||
if(statistic.get(i).equals("峰度")){
|
||||
double kurtosis = statisticsUtil.getKurtosis(map.get(key));
|
||||
statistics.setKurtosis(kurtosis);
|
||||
|
||||
}
|
||||
if(statistic.get(i).equals("偏度")){
|
||||
double skewness = statisticsUtil.getSkewness(map.get(key));
|
||||
statistics.setSkewness(skewness);
|
||||
|
||||
}
|
||||
if(statistic.get(i).equals("最大值")){
|
||||
double max = statisticsUtil.getMax(map.get(key));
|
||||
statistics.setMax(max);
|
||||
|
||||
}
|
||||
if(statistic.get(i).equals("最小值")){
|
||||
double min = statisticsUtil.getMin(map.get(key));
|
||||
statistics.setMin(min);
|
||||
|
||||
}
|
||||
if(statistic.get(i).equals("求和")){
|
||||
double sum = statisticsUtil.getSum(map.get(key));
|
||||
statistics.setSummation(sum);
|
||||
|
||||
}
|
||||
if(statistic.get(i).equals("观测数")){
|
||||
int count = statisticsUtil.getCount(map.get(key));
|
||||
statistics.setObservations(count);
|
||||
}
|
||||
|
||||
}
|
||||
statisticsDTO.setStatistics(statistics);
|
||||
|
||||
dtoList.add(statisticsDTO);
|
||||
|
||||
}
|
||||
return new ResultEntity(HttpStatus.OK,"成功",dtoList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> viewMetrics(String userId, String tableName) {
|
||||
List<String> list=new ArrayList<>();
|
||||
|
||||
if(tableName.equals(Constant.YHSXB)){
|
||||
list=indicatorsMapper.getYHSXB();
|
||||
}
|
||||
if(tableName.equals(Constant.YHDLHYB)){
|
||||
list=indicatorsMapper.getYHDLHYB();
|
||||
}
|
||||
if(tableName.equals(Constant.YHXFNLB)){
|
||||
list=indicatorsMapper.getYHXFNLB();
|
||||
}
|
||||
if(tableName.equals(Constant.YHPLB) || tableName.equals(Constant.YHXWB)){
|
||||
list=indicatorsMapper.getYHPLB();
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultEntity viewAnalyzeData(String userId, String tableName, List<String> fieldList) {
|
||||
|
||||
String table=null;
|
||||
|
||||
|
||||
if(tableName.equals(Constant.YHSXB)){ //查询用户属性表
|
||||
table="stu_user_attribute";
|
||||
}
|
||||
|
||||
if(tableName.equals(Constant.YHDLHYB)){ //查询用户登录活跃表
|
||||
table="stu_user_login_active";
|
||||
}
|
||||
|
||||
if(tableName.equals(Constant.YHXFNLB)){ //查询用户消费能力表
|
||||
table="stu_user_consumption_ability";
|
||||
}
|
||||
|
||||
if(tableName.equals(Constant.YHPLB) || tableName.equals(Constant.YHXWB)){ //查询用户评论或行为表
|
||||
table="stu_user_behavior";
|
||||
}
|
||||
|
||||
List<Map<String,Object>> attributes = tableNameMapper.selectByFields(fieldList,table);
|
||||
|
||||
|
||||
|
||||
// List<Object> createTime = attributes.get("create_time");
|
||||
|
||||
return new ResultEntity(HttpStatus.OK,attributes);
|
||||
}
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
package com.sztzjy.marketing.util.algorithm;
|
||||
|
||||
public class LinearRegression {
|
||||
private double intercept;
|
||||
private double slope;
|
||||
|
||||
// 线性回归的训练方法
|
||||
public void fit(double[] x, double[] y) {
|
||||
int n = x.length;
|
||||
double sumX = 0.0, sumY = 0.0, sumXY = 0.0, sumX2 = 0.0;
|
||||
|
||||
for (int i = 0; i < n; i++) {
|
||||
sumX += x[i];
|
||||
sumY += y[i];
|
||||
sumXY += x[i] * y[i];
|
||||
sumX2 += x[i] * x[i];
|
||||
}
|
||||
|
||||
double xMean = sumX / n;
|
||||
double yMean = sumY / n;
|
||||
|
||||
this.slope = (sumXY - n * xMean * yMean) / (sumX2 - n * xMean * xMean);
|
||||
this.intercept = yMean - this.slope * xMean;
|
||||
}
|
||||
|
||||
// 预测方法
|
||||
public double predict(double x) {
|
||||
return this.intercept + this.slope * x;
|
||||
}
|
||||
|
||||
// 获取截距
|
||||
public double getIntercept() {
|
||||
return this.intercept;
|
||||
}
|
||||
|
||||
// 获取斜率
|
||||
public double getSlope() {
|
||||
return this.slope;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
// 示例数据
|
||||
double[] x = {1, 2, 3, 4, 5};
|
||||
double[] y = {2, 3, 5, 6, 8};
|
||||
|
||||
// 创建线性回归模型
|
||||
LinearRegression lr = new LinearRegression();
|
||||
lr.fit(x, y);
|
||||
|
||||
// 输出模型参数
|
||||
System.out.println("截距: " + lr.getIntercept());
|
||||
System.out.println("斜率: " + lr.getSlope());
|
||||
|
||||
// 预测新数据
|
||||
double newX = 6;
|
||||
double predictedY = lr.predict(newX);
|
||||
System.out.println("输入x: " + newX + "预测y=" + predictedY);
|
||||
}
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
package com.sztzjy.marketing.util.algorithm;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class TrainDataSet {
|
||||
|
||||
/**
|
||||
* 特征集合
|
||||
**/
|
||||
public List<double[]> features = new ArrayList<>();
|
||||
/**
|
||||
* 标签集合
|
||||
**/
|
||||
public List<Double> labels = new ArrayList<>();
|
||||
/**
|
||||
* 特征向量维度
|
||||
**/
|
||||
public int featureDim;
|
||||
|
||||
public int size() {
|
||||
return labels.size();
|
||||
}
|
||||
|
||||
public double[] getFeature(int index) {
|
||||
return features.get(index);
|
||||
}
|
||||
|
||||
public double getLabel(int index) {
|
||||
return labels.get(index);
|
||||
}
|
||||
|
||||
public void addData(double[] feature, double label) {
|
||||
if (features.isEmpty()) {
|
||||
featureDim = feature.length;
|
||||
} else {
|
||||
if (featureDim != feature.length) {
|
||||
throwDimensionMismatchException(feature.length);
|
||||
}
|
||||
}
|
||||
features.add(feature);
|
||||
labels.add(label);
|
||||
}
|
||||
|
||||
public void throwDimensionMismatchException(int errorLen) {
|
||||
throw new RuntimeException("DimensionMismatchError: 你应该传入维度为 " + featureDim + " 的特征向量 , 但你传入了维度为 " + errorLen + " 的特征向量");
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,226 @@
|
||||
<?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.marketing.mapper.StuTableNameMapper">
|
||||
<resultMap id="BaseResultMap" type="com.sztzjy.marketing.entity.StuTableName">
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="user_id" jdbcType="VARCHAR" property="userId" />
|
||||
<result column="table_name" jdbcType="VARCHAR" property="tableName" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
</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">
|
||||
id, user_id, table_name, create_time, update_time
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.sztzjy.marketing.entity.StuTableNameExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from stu_table_name
|
||||
<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.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from stu_table_name
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from stu_table_name
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="com.sztzjy.marketing.entity.StuTableNameExample">
|
||||
delete from stu_table_name
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.sztzjy.marketing.entity.StuTableName">
|
||||
insert into stu_table_name (id, user_id, table_name,
|
||||
create_time, update_time)
|
||||
values (#{id,jdbcType=INTEGER}, #{userId,jdbcType=VARCHAR}, #{tableName,jdbcType=VARCHAR},
|
||||
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.sztzjy.marketing.entity.StuTableName">
|
||||
insert into stu_table_name
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
user_id,
|
||||
</if>
|
||||
<if test="tableName != null">
|
||||
table_name,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
#{userId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="tableName != null">
|
||||
#{tableName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="com.sztzjy.marketing.entity.StuTableNameExample" resultType="java.lang.Long">
|
||||
select count(*) from stu_table_name
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update stu_table_name
|
||||
<set>
|
||||
<if test="record.id != null">
|
||||
id = #{record.id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.userId != null">
|
||||
user_id = #{record.userId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.tableName != null">
|
||||
table_name = #{record.tableName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.createTime != null">
|
||||
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="record.updateTime != null">
|
||||
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</set>
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByExample" parameterType="map">
|
||||
update stu_table_name
|
||||
set id = #{record.id,jdbcType=INTEGER},
|
||||
user_id = #{record.userId,jdbcType=VARCHAR},
|
||||
table_name = #{record.tableName,jdbcType=VARCHAR},
|
||||
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||
update_time = #{record.updateTime,jdbcType=TIMESTAMP}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.marketing.entity.StuTableName">
|
||||
update stu_table_name
|
||||
<set>
|
||||
<if test="userId != null">
|
||||
user_id = #{userId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="tableName != null">
|
||||
table_name = #{tableName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.sztzjy.marketing.entity.StuTableName">
|
||||
update stu_table_name
|
||||
set user_id = #{userId,jdbcType=VARCHAR},
|
||||
table_name = #{tableName,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
<select id="getTableName" resultType="java.lang.String">
|
||||
select table_name from stu_table_name where user_id=#{userId}
|
||||
</select>
|
||||
<select id="selectByFields" resultType="java.util.Map">
|
||||
SELECT
|
||||
<foreach collection="fieldList" item="field" separator=",">
|
||||
${field}
|
||||
</foreach>
|
||||
FROM ${table}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
@ -0,0 +1,386 @@
|
||||
<?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.marketing.mapper.StuUserBehaviorMapper">
|
||||
<resultMap id="BaseResultMap" type="com.sztzjy.marketing.entity.StuUserBehavior">
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="user_id" jdbcType="VARCHAR" property="userId" />
|
||||
<result column="login_name" jdbcType="VARCHAR" property="loginName" />
|
||||
<result column="user_name" jdbcType="VARCHAR" property="userName" />
|
||||
<result column="student_id" jdbcType="VARCHAR" property="studentId" />
|
||||
<result column="stu_class" jdbcType="VARCHAR" property="stuClass" />
|
||||
<result column="major" jdbcType="VARCHAR" property="major" />
|
||||
<result column="school" jdbcType="VARCHAR" property="school" />
|
||||
<result column="role_name" jdbcType="VARCHAR" property="roleName" />
|
||||
<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="behavior_date" jdbcType="TIMESTAMP" property="behaviorDate" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
</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">
|
||||
id, user_id, login_name, user_name, student_id, stu_class, major, school, role_name,
|
||||
goods_name, goods_type, goods_subcategories, user_behavior_type, behavior_date, create_time,
|
||||
update_time
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.sztzjy.marketing.entity.StuUserBehaviorExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_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="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from stu_user_behavior
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from stu_user_behavior
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="com.sztzjy.marketing.entity.StuUserBehaviorExample">
|
||||
delete from stu_user_behavior
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.sztzjy.marketing.entity.StuUserBehavior">
|
||||
insert into stu_user_behavior (id, user_id, login_name,
|
||||
user_name, student_id, stu_class,
|
||||
major, school, role_name,
|
||||
goods_name, goods_type, goods_subcategories,
|
||||
user_behavior_type, behavior_date, create_time,
|
||||
update_time)
|
||||
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})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.sztzjy.marketing.entity.StuUserBehavior">
|
||||
insert into stu_user_behavior
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
user_id,
|
||||
</if>
|
||||
<if test="loginName != null">
|
||||
login_name,
|
||||
</if>
|
||||
<if test="userName != null">
|
||||
user_name,
|
||||
</if>
|
||||
<if test="studentId != null">
|
||||
student_id,
|
||||
</if>
|
||||
<if test="stuClass != null">
|
||||
stu_class,
|
||||
</if>
|
||||
<if test="major != null">
|
||||
major,
|
||||
</if>
|
||||
<if test="school != null">
|
||||
school,
|
||||
</if>
|
||||
<if test="roleName != null">
|
||||
role_name,
|
||||
</if>
|
||||
<if test="goodsName != null">
|
||||
goods_name,
|
||||
</if>
|
||||
<if test="goodsType != null">
|
||||
goods_type,
|
||||
</if>
|
||||
<if test="goodsSubcategories != null">
|
||||
goods_subcategories,
|
||||
</if>
|
||||
<if test="userBehaviorType != null">
|
||||
user_behavior_type,
|
||||
</if>
|
||||
<if test="behaviorDate != null">
|
||||
behavior_date,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
#{userId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="loginName != null">
|
||||
#{loginName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userName != null">
|
||||
#{userName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="studentId != null">
|
||||
#{studentId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="stuClass != null">
|
||||
#{stuClass,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="major != null">
|
||||
#{major,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="school != null">
|
||||
#{school,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="roleName != null">
|
||||
#{roleName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="goodsName != null">
|
||||
#{goodsName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="goodsType != null">
|
||||
#{goodsType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="goodsSubcategories != null">
|
||||
#{goodsSubcategories,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userBehaviorType != null">
|
||||
#{userBehaviorType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="behaviorDate != null">
|
||||
#{behaviorDate,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="com.sztzjy.marketing.entity.StuUserBehaviorExample" resultType="java.lang.Long">
|
||||
select count(*) from stu_user_behavior
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update stu_user_behavior
|
||||
<set>
|
||||
<if test="record.id != null">
|
||||
id = #{record.id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.userId != null">
|
||||
user_id = #{record.userId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.loginName != null">
|
||||
login_name = #{record.loginName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.userName != null">
|
||||
user_name = #{record.userName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.studentId != null">
|
||||
student_id = #{record.studentId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.stuClass != null">
|
||||
stu_class = #{record.stuClass,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.major != null">
|
||||
major = #{record.major,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.school != null">
|
||||
school = #{record.school,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.roleName != null">
|
||||
role_name = #{record.roleName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.goodsName != null">
|
||||
goods_name = #{record.goodsName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.goodsType != null">
|
||||
goods_type = #{record.goodsType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.goodsSubcategories != null">
|
||||
goods_subcategories = #{record.goodsSubcategories,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.userBehaviorType != null">
|
||||
user_behavior_type = #{record.userBehaviorType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.behaviorDate != null">
|
||||
behavior_date = #{record.behaviorDate,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="record.createTime != null">
|
||||
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="record.updateTime != null">
|
||||
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</set>
|
||||
<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},
|
||||
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=VARCHAR},
|
||||
behavior_date = #{record.behaviorDate,jdbcType=TIMESTAMP},
|
||||
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||
update_time = #{record.updateTime,jdbcType=TIMESTAMP}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.marketing.entity.StuUserBehavior">
|
||||
update stu_user_behavior
|
||||
<set>
|
||||
<if test="userId != null">
|
||||
user_id = #{userId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="loginName != null">
|
||||
login_name = #{loginName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userName != null">
|
||||
user_name = #{userName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="studentId != null">
|
||||
student_id = #{studentId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="stuClass != null">
|
||||
stu_class = #{stuClass,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="major != null">
|
||||
major = #{major,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="school != null">
|
||||
school = #{school,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="roleName != null">
|
||||
role_name = #{roleName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="goodsName != null">
|
||||
goods_name = #{goodsName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="goodsType != null">
|
||||
goods_type = #{goodsType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="goodsSubcategories != null">
|
||||
goods_subcategories = #{goodsSubcategories,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userBehaviorType != null">
|
||||
user_behavior_type = #{userBehaviorType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="behaviorDate != null">
|
||||
behavior_date = #{behaviorDate,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</set>
|
||||
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},
|
||||
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=VARCHAR},
|
||||
behavior_date = #{behaviorDate,jdbcType=TIMESTAMP},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
</mapper>
|
Loading…
Reference in New Issue