Browse Source

fixup! 日常提交

master
xyiege 4 years ago
parent
commit
8dc98ffe5f
  1. 212
      src/main/java/cn/chjyj/szwh/bean/Goods.java
  2. 21
      src/main/java/cn/chjyj/szwh/mapper/GoodsMapper.java
  3. 118
      src/main/resources/mapper/szwh/GoodsMapper.xml

212
src/main/java/cn/chjyj/szwh/bean/Goods.java

@ -0,0 +1,212 @@
package cn.chjyj.szwh.bean;
import java.math.BigInteger;
import java.sql.Timestamp;
/**
* 交易商品信息
* 2022.06.23
*/
public class Goods {
private Integer id;
private Integer userId;//用户编号
private String userIslicode;//委托方isli标识码
private String username;//委托方名称
private Integer goodsDetailsId;//商品明细id
private String goodsIslicode; //商品isli标识码
private String isLicode;//sliCode
private Integer saleCount;//销售量
private BigInteger clickCount;//点击量
private Integer isRecommend;//是否推荐;0:否;1:是
private Integer recommendSort;//推荐排序
private Timestamp createTime; //创建时间
private Timestamp updateTime;//修改时间
private Timestamp cancelTime;//撤销时间
/**
* 商品状态开关
*/
private Integer goodsStatus;//商品状态;1:上架中;2:下架中;3:已转让;4:已失效;5:冻结中;6:下架中
private Integer oldStatus;//是否是旧周期数据 0:yes
private Integer entrustStatus;//委托接口委托数据状态
private Integer applyOut;//是否申请下架;0:否;1:是
private Integer isDeleted;//删除状态;0:未删除;1:已删除
private Integer contractStatus;//是否申请合约关联;0:失败;1:成功
private Timestamp contractualStartTime;//委托开始时间
private Timestamp contractualtimeEndTime;//委托结束时间
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public String getUserIslicode() {
return userIslicode;
}
public void setUserIslicode(String userIslicode) {
this.userIslicode = userIslicode;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public Integer getGoodsDetailsId() {
return goodsDetailsId;
}
public void setGoodsDetailsId(Integer goodsDetailsId) {
this.goodsDetailsId = goodsDetailsId;
}
public String getGoodsIslicode() {
return goodsIslicode;
}
public void setGoodsIslicode(String goodsIslicode) {
this.goodsIslicode = goodsIslicode;
}
public String getIsLicode() {
return isLicode;
}
public void setIsLicode(String isLicode) {
this.isLicode = isLicode;
}
public Integer getSaleCount() {
return saleCount;
}
public void setSaleCount(Integer saleCount) {
this.saleCount = saleCount;
}
public BigInteger getClickCount() {
return clickCount;
}
public void setClickCount(BigInteger clickCount) {
this.clickCount = clickCount;
}
public Integer getIsRecommend() {
return isRecommend;
}
public void setIsRecommend(Integer isRecommend) {
this.isRecommend = isRecommend;
}
public Integer getRecommendSort() {
return recommendSort;
}
public void setRecommendSort(Integer recommendSort) {
this.recommendSort = recommendSort;
}
public Timestamp getCreateTime() {
return createTime;
}
public void setCreateTime(Timestamp createTime) {
this.createTime = createTime;
}
public Timestamp getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Timestamp updateTime) {
this.updateTime = updateTime;
}
public Timestamp getCancelTime() {
return cancelTime;
}
public void setCancelTime(Timestamp cancelTime) {
this.cancelTime = cancelTime;
}
public Integer getGoodsStatus() {
return goodsStatus;
}
public void setGoodsStatus(Integer goodsStatus) {
this.goodsStatus = goodsStatus;
}
public Integer getOldStatus() {
return oldStatus;
}
public void setOldStatus(Integer oldStatus) {
this.oldStatus = oldStatus;
}
public Integer getEntrustStatus() {
return entrustStatus;
}
public void setEntrustStatus(Integer entrustStatus) {
this.entrustStatus = entrustStatus;
}
public Integer getApplyOut() {
return applyOut;
}
public void setApplyOut(Integer applyOut) {
this.applyOut = applyOut;
}
public Integer getIsDeleted() {
return isDeleted;
}
public void setIsDeleted(Integer isDeleted) {
this.isDeleted = isDeleted;
}
public Integer getContractStatus() {
return contractStatus;
}
public void setContractStatus(Integer contractStatus) {
this.contractStatus = contractStatus;
}
public Timestamp getContractualStartTime() {
return contractualStartTime;
}
public void setContractualStartTime(Timestamp contractualStartTime) {
this.contractualStartTime = contractualStartTime;
}
public Timestamp getContractualtimeEndTime() {
return contractualtimeEndTime;
}
public void setContractualtimeEndTime(Timestamp contractualtimeEndTime) {
this.contractualtimeEndTime = contractualtimeEndTime;
}
}

21
src/main/java/cn/chjyj/szwh/mapper/GoodsMapper.java

@ -0,0 +1,21 @@
package cn.chjyj.szwh.mapper;
import cn.chjyj.szwh.bean.Goods;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* 商品mapper
*/
@Component
public interface GoodsMapper {
/**
* 商品列表
* @param startRs
* @param pageSize
* @return
*/
List<Goods> getGoodsList(@Param("startRs") int startRs, @Param("pageSize") int pageSize);
}

118
src/main/resources/mapper/szwh/GoodsMapper.xml

@ -0,0 +1,118 @@
<?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="cn.chjyj.employee.mapper.UserMapper">
<sql id="column">
id\user_id` int(11) NOT NULL DEFAULT '0' COMMENT '用户ID',
`user_islicode` varchar(255) NOT NULL COMMENT '委托方isli标识码',
`username` varchar(50) DEFAULT NULL COMMENT '委托方名称',
`goods_detail_id` int(11) NOT NULL COMMENT '商品明细ID',
`goods_islicode` varchar(255) NOT NULL COMMENT '商品isli标识码',
`islicode` varchar(200) DEFAULT NULL COMMENT 'isliCode',
`sale_count` int(11) NOT NULL DEFAULT '0' COMMENT '销售量',
`click_count` int(11) NOT NULL DEFAULT '0' COMMENT '点击量',
`is_recommend` int(1) NOT NULL DEFAULT '0' COMMENT '是否推荐;0:否;1:是',
`recommend_sort` int(10) NOT NULL DEFAULT '0' COMMENT '推荐排序',
`createtime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updatetime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
`canceltime` datetime DEFAULT NULL COMMENT '撤销时间',
`goods_status` int(1) NOT NULL DEFAULT '1' COMMENT '商品状态;1:上架中;2:下架中;3:已转让;4:已失效;5:冻结中;6:下架中',
`old_status` int(1) NOT NULL DEFAULT '0' COMMENT '是否是旧周期数据',
`entrust_status` int(1) NOT NULL DEFAULT '0' COMMENT '委托接口委托数据状态',
`apply_out` int(1) NOT NULL DEFAULT '0' COMMENT '是否申请下架;0:否;1:是',
`is_deleted` int(1) DEFAULT '0' COMMENT '删除状态;0:未删除;1:已删除',
`contract_status` int(1) NOT NULL DEFAULT '0' COMMENT '是否申请合约关联;0:失败;1:成功',
`contractual_start_time` datetime DEFAULT NULL COMMENT '委托开始时间',
`contractualtime_end_time` datetime DEFAULT NULL COMMENT '委托结束时间',
</sql>
<sql id="tbName">goods</sql>
<!--查询记录列表-->
<select id="getGoodsList" parameterType="java.lang.Integer" resultType="cn.chjyj.employee.bean.User">
select * from
<include refid="tbName"/>
order by uid DESC
limit #{pageSize} where id> #{startRs};
</select>
<!--根据uid查询用户-->
<select id="getUserByUid" parameterType="java.lang.Integer" resultType="cn.chjyj.employee.bean.User">
select <include refid="column"/>
from <include refid="tbName"/>
where uid=#{uid}
</select>
<!--查询用户名,加上密码-->
<select id="getUserByUname" parameterType="java.lang.String" resultType="cn.chjyj.employee.bean.User">
select <include refid="column"/>,password
from <include refid="tbName"/>
where uname=#{uname} limit 1;
</select>
<!--查询用户-->
<select id="getSingleUserByOpenid" parameterType="java.lang.String" resultType="cn.chjyj.employee.bean.User">
select <include refid="column"/> from
<include refid="tbName"/>
where openid=#{openid};
</select>
<!--新增用户-->
<insert id="addUser" parameterType="cn.chjyj.employee.bean.User" useGeneratedKeys="true" keyColumn="uid">
insert into <include refid="tbName"/>
(uname,password,gender,urealname,ubirth,nickname,avatarurl,platfrom,sessionkey,openid)
values (
#{uname},
#{password},
#{gender},
#{urealname},
#{ubirth},
#{nickname},
#{avatarurl},
#{platfrom},
#{sessionkey},
#{openid}
)
</insert>
<update id="upUser" parameterType="cn.chjyj.employee.bean.User">
update <include refid="tbName"/>
set
<if test="password!=null">
password=#{password},
</if>
<if test="urealname!=null">
urealname=#{urealname},
</if>
<if test="ubirth!=null">
ubirth =#{ubirth},
</if>
<if test="gender!=null">
gender=#{gender},
</if>
<if test="nickName!=null">
nickname=#{nickName},
</if>
<if test="avatarurl!=null">
avatarurl=#{avatarurl},
</if>
<if test="nickname!=null">
nickname=#{nickname},
</if>
<if test="platfrom!=null">
platfrom=#{platfrom},
</if>
<if test="sessionkey!=null">
sessionkey=#{sessionkey},
</if>
<if test="openid!=null">
openid=#{openid},
</if>
uname=#{uname}
where uid=#{uid};
</update>
</mapper>
Loading…
Cancel
Save