From b9d7fc4c35a3dd596efeabd7b5f84fdbc23494f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=AE=87=E8=88=AA?= <19856072110@163.com> Date: Tue, 17 Dec 2024 10:03:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/wsk/bean/ShopContextBean.java | 64 ++++++++++++++++++ .../java/com/wsk/dao/ShopContextMapper.java | 27 ++++++++ src/main/java/com/wsk/pojo/ShopContext.java | 66 +++++++++++++++++++ .../wsk/service/Impl/ShopCarServiceImpl.java | 62 +++++++++++++++++ 4 files changed, 219 insertions(+) create mode 100644 src/main/java/com/wsk/bean/ShopContextBean.java create mode 100644 src/main/java/com/wsk/dao/ShopContextMapper.java create mode 100644 src/main/java/com/wsk/pojo/ShopContext.java create mode 100644 src/main/java/com/wsk/service/Impl/ShopCarServiceImpl.java diff --git a/src/main/java/com/wsk/bean/ShopContextBean.java b/src/main/java/com/wsk/bean/ShopContextBean.java new file mode 100644 index 0000000..b0bbf87 --- /dev/null +++ b/src/main/java/com/wsk/bean/ShopContextBean.java @@ -0,0 +1,64 @@ +package com.wsk.bean; + +import java.io.Serializable; +import java.util.Date; + +/** + * Created by wsk1103 on 2017/5/21. + */ +public class ShopContextBean implements Serializable { + private int id; + private Date modified; + private int sid; + private String context; + private int uid; + private String username; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public Date getModified() { + return modified; + } + + public void setModified(Date modified) { + this.modified = modified; + } + + public int getSid() { + return sid; + } + + public void setSid(int sid) { + this.sid = sid; + } + + public String getContext() { + return context; + } + + public void setContext(String context) { + this.context = context; + } + + public int getUid() { + return uid; + } + + public void setUid(int uid) { + this.uid = uid; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } +} diff --git a/src/main/java/com/wsk/dao/ShopContextMapper.java b/src/main/java/com/wsk/dao/ShopContextMapper.java new file mode 100644 index 0000000..8a661e9 --- /dev/null +++ b/src/main/java/com/wsk/dao/ShopContextMapper.java @@ -0,0 +1,27 @@ +package com.wsk.dao; + +import com.wsk.pojo.ShopContext; +import org.apache.ibatis.annotations.Select; + +import java.util.List; + +public interface ShopContextMapper { + int deleteByPrimaryKey(Integer id); + + int insert(ShopContext record); + + int insertSelective(ShopContext record); + + ShopContext selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(ShopContext record); + + int updateByPrimaryKey(ShopContext record); + + int getCounts(int sid); + + List findById(int sid, int start); + + @Select("select * from shopcontext where sid=#{id,jdbcType=INTEGER} and display=1") + List selectBySid(int id); +} \ No newline at end of file diff --git a/src/main/java/com/wsk/pojo/ShopContext.java b/src/main/java/com/wsk/pojo/ShopContext.java new file mode 100644 index 0000000..ccb3a99 --- /dev/null +++ b/src/main/java/com/wsk/pojo/ShopContext.java @@ -0,0 +1,66 @@ +package com.wsk.pojo; + +import java.io.Serializable; +import java.util.Date; + +public class ShopContext implements Serializable { + private Integer id; + + private Date modified; + + private Integer sid; + + private String context; + + private Integer display; + + private int uid; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Date getModified() { + return modified == null ? null : (Date) modified.clone(); + } + + public void setModified(Date modified) { + this.modified = modified == null ? null : (Date) modified.clone(); + } + + public Integer getSid() { + return sid; + } + + public void setSid(Integer sid) { + this.sid = sid; + } + + public String getContext() { + return context; + } + + public void setContext(String context) { + this.context = context == null ? null : context.trim(); + } + + public Integer getDisplay() { + return display; + } + + public void setDisplay(Integer display) { + this.display = display; + } + + public int getUid() { + return uid; + } + + public void setUid(int uid) { + this.uid = uid; + } +} \ No newline at end of file diff --git a/src/main/java/com/wsk/service/Impl/ShopCarServiceImpl.java b/src/main/java/com/wsk/service/Impl/ShopCarServiceImpl.java new file mode 100644 index 0000000..dcb3bff --- /dev/null +++ b/src/main/java/com/wsk/service/Impl/ShopCarServiceImpl.java @@ -0,0 +1,62 @@ +package com.wsk.service.Impl; + +import com.wsk.dao.ShopCarMapper; +import com.wsk.pojo.ShopCar; +import com.wsk.service.ShopCarService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; + +/** + * Created by wsk1103 on 2017/5/13. + */ +@Service +public class ShopCarServiceImpl implements ShopCarService { + @Resource + private ShopCarMapper shopCarMapper; + + @Override + public int deleteByPrimaryKey(Integer id) { + return 0; + } + + @Override + public int insert(ShopCar record) { + return shopCarMapper.insert(record); + } + + @Override + public int insertSelective(ShopCar record) { + return shopCarMapper.insertSelective(record); + } + + @Override + public ShopCar selectByPrimaryKey(Integer id) { + return shopCarMapper.selectByPrimaryKey(id); + } + + @Override + public int updateByPrimaryKeySelective(ShopCar record) { + return shopCarMapper.updateByPrimaryKeySelective(record); + } + + @Override + public int updateByPrimaryKey(ShopCar record) { + return shopCarMapper.updateByPrimaryKey(record); + } + + @Override + public int getCounts(int uid) { + return shopCarMapper.getCounts(uid); + } + +// @Override +// public List selectByUid(int uid, int start) { +// return shopCarMapper.selectByUid(uid, start); +// } + + @Override + public ShopCar selectByUid(int uid) { + return shopCarMapper.selectByUid(uid); + } +}