New file |
| | |
| | | package com.panzhihua.common.model.vos.jinhui; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @Builder |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @ApiModel("金汇商城订单表") |
| | | public class JinhuiShoppingOrderVO implements Serializable { |
| | | private static final long serialVersionUID = -70884515430727555L; |
| | | |
| | | @ApiModelProperty(value = "主键") |
| | | private String id; |
| | | |
| | | @ApiModelProperty(value = "订单号") |
| | | private String orderNumber; |
| | | |
| | | @ApiModelProperty(value = "商品id") |
| | | private String goodsId; |
| | | |
| | | @ApiModelProperty(value = "下单人id") |
| | | private String userId; |
| | | |
| | | @ApiModelProperty(value = "核销状态(0待核销 1已核销)") |
| | | private String cancelType; |
| | | |
| | | @ApiModelProperty(value = "核销时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date cancelTime; |
| | | |
| | | @ApiModelProperty(value = "支付金额") |
| | | private String palyMoney; |
| | | |
| | | @ApiModelProperty(value = "创建时间(兑换时间)") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date creationTime; |
| | | |
| | | @ApiModelProperty(value = "更新时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date updateTime; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_jinhui_community.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.vos.jinhui.JinhuiShoppingOrderVO; |
| | | import com.panzhihua.common.model.vos.jinhui.JinhuiShoppingVO; |
| | | import com.panzhihua.service_jinhui_community.entity.JinhuiShopping; |
| | | import com.panzhihua.service_jinhui_community.entity.JinhuiShoppingOrder; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | @Mapper |
| | | public interface JinhuiShoppingOrderDao extends BaseMapper<JinhuiShoppingOrder> |
| | | { |
| | | /** |
| | | * 列表 |
| | | * @param |
| | | * @return |
| | | */ |
| | | IPage<JinhuiShoppingOrder> getList(Page page, |
| | | @Param("goodsId") String goodsId, |
| | | @Param("orderNumber") String orderNumber, |
| | | @Param("goodName") String goodName, |
| | | @Param("name") String name, |
| | | @Param("cancelType") String cancelType); |
| | | |
| | | /** |
| | | * 详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | JinhuiShoppingOrder getDetails(@Param("id") String id); |
| | | |
| | | /** |
| | | * 新增 |
| | | * @param |
| | | * @return |
| | | */ |
| | | int addData(@Param("item") JinhuiShoppingOrderVO item); |
| | | |
| | | |
| | | /** |
| | | * 编辑 |
| | | * @param item |
| | | * @return |
| | | */ |
| | | int editData(@Param("item") JinhuiShoppingOrderVO item); |
| | | |
| | | /** |
| | | * 删除 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | int expurgateData(@Param("id") String id); |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_jinhui_community.entity; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @Builder |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @ApiModel("金汇商城订单表") |
| | | public class JinhuiShoppingOrder implements Serializable { |
| | | private static final long serialVersionUID = -70884515430727555L; |
| | | |
| | | @ApiModelProperty(value = "主键") |
| | | private String id; |
| | | |
| | | @ApiModelProperty(value = "订单号") |
| | | private String orderNumber; |
| | | |
| | | @ApiModelProperty(value = "商品id") |
| | | private String goodsId; |
| | | |
| | | @ApiModelProperty(value = "下单人id") |
| | | private String userId; |
| | | |
| | | @ApiModelProperty(value = "核销状态(0待核销 1已核销)") |
| | | private String cancelType; |
| | | |
| | | @ApiModelProperty(value = "核销时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date cancelTime; |
| | | |
| | | @ApiModelProperty(value = "支付金额") |
| | | private String palyMoney; |
| | | |
| | | @ApiModelProperty(value = "创建时间(兑换时间)") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date creationTime; |
| | | |
| | | @ApiModelProperty(value = "更新时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date updateTime; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_jinhui_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.jinhui.JinhuiShoppingOrderVO; |
| | | import com.panzhihua.service_jinhui_community.entity.JinhuiShoppingOrder; |
| | | |
| | | public interface JinhuiShoppingOrderService extends IService<JinhuiShoppingOrder> |
| | | { |
| | | /** |
| | | * 分页查询 |
| | | * @param |
| | | * @return |
| | | */ |
| | | R getList(int pageNum,int pageSize,String goodsId,String orderNumber, |
| | | String goodName,String name,String cancelType); |
| | | |
| | | JinhuiShoppingOrder getDetails(String id); |
| | | /** |
| | | * 新增 |
| | | * @param |
| | | * @return |
| | | */ |
| | | R addData(JinhuiShoppingOrderVO item); |
| | | |
| | | R editData(JinhuiShoppingOrderVO item); |
| | | |
| | | R expurgateData(String id); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_jinhui_community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.jinhui.JinhuiShoppingOrderVO; |
| | | import com.panzhihua.common.model.vos.jinhui.JinhuiShoppingVO; |
| | | import com.panzhihua.service_jinhui_community.dao.JinhuiShoppingDao; |
| | | import com.panzhihua.service_jinhui_community.dao.JinhuiShoppingOrderDao; |
| | | import com.panzhihua.service_jinhui_community.entity.JinhuiShopping; |
| | | import com.panzhihua.service_jinhui_community.entity.JinhuiShoppingOrder; |
| | | import com.panzhihua.service_jinhui_community.service.JinhuiShoppingOrderService; |
| | | import com.panzhihua.service_jinhui_community.service.JinhuiShoppingService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | |
| | | @Slf4j |
| | | @Service |
| | | public class JinhuiShoppingOrderServiceImpl extends ServiceImpl<JinhuiShoppingOrderDao, |
| | | JinhuiShoppingOrder> implements JinhuiShoppingOrderService |
| | | { |
| | | |
| | | @Override |
| | | public R getList(int pageNum,int pageSize,String goodsId,String orderNumber, |
| | | String goodName,String name,String cancelType) |
| | | { |
| | | Page page = new Page<JinhuiShopping>(pageNum,pageSize); |
| | | return R.ok(baseMapper.getList(page,goodsId,orderNumber,goodName,name,cancelType)); |
| | | } |
| | | |
| | | @Override |
| | | public JinhuiShoppingOrder getDetails(String id) { |
| | | return baseMapper.getDetails(id); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public R addData(JinhuiShoppingOrderVO item) |
| | | { |
| | | int num= baseMapper.addData(item); |
| | | if(num>0) |
| | | { |
| | | return R.ok(); |
| | | } |
| | | return R.fail("添加失败"); |
| | | } |
| | | |
| | | @Override |
| | | public R editData(JinhuiShoppingOrderVO item) { |
| | | int num= baseMapper.editData(item); |
| | | if(num>0) |
| | | { |
| | | return R.ok(); |
| | | } |
| | | return R.fail("添加失败"); |
| | | } |
| | | |
| | | @Override |
| | | public R expurgateData(String id) { |
| | | int num= baseMapper.expurgateData(id); |
| | | if(num>0) |
| | | { |
| | | return R.ok(); |
| | | } |
| | | return R.fail("添加失败"); |
| | | } |
| | | } |
| | |
| | | #{item.interspaceId}, |
| | | </if> |
| | | <if test="item.interspaceTime != null and item.interspaceTime != '' "> |
| | | #{item.interspaceId}, |
| | | #{item.interspaceTime}, |
| | | </if> |
| | | <if test="item.subscribeTimeFrame != null and item.subscribeTimeFrame != '' "> |
| | | #{item.subscribeTimeFrame}, |
| | |
| | | interspace_id=#{item.interspaceId}, |
| | | </if> |
| | | <if test="item.interspaceTime != null and item.interspaceTime != '' "> |
| | | interspace_time=#{item.interspaceId}, |
| | | interspace_time=#{item.interspaceTime}, |
| | | </if> |
| | | <if test="item.subscribeTimeFrame != null and item.subscribeTimeFrame != '' "> |
| | | subscribe_time_frame=#{item.subscribeTimeFrame}, |
New file |
| | |
| | | <?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.panzhihua.service_jinhui_community.dao.JinhuiShoppingOrderDao"> |
| | | |
| | | <resultMap type="com.panzhihua.service_jinhui_community.entity.JinhuiShoppingOrder" id="itemMap"> |
| | | <result property="id" column="id" /> |
| | | <result property="orderNumber" column="order_number" /> |
| | | <result property="goodsId" column="goods_id" /> |
| | | <result property="userId" column="user_id" /> |
| | | <result property="cancelType" column="cancel_type" /> |
| | | <result property="cancelTime" column=" cancel_time" /> |
| | | <result property="palyMoney" column="paly_money" /> |
| | | <result property="creationTime" column="creation_time" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | </resultMap> |
| | | |
| | | <!-- 分页查询 --> |
| | | <select id="getList" resultMap="itemMap"> |
| | | select |
| | | jso.id, |
| | | jso.order_number, |
| | | jso.goods_id, |
| | | js.good_name, |
| | | js.good_price, |
| | | js.cover_img_url, |
| | | jso.user_id, |
| | | su.name, |
| | | su.phone, |
| | | jso.creation_time, |
| | | jso.cancel_type, |
| | | jso.update_time, |
| | | jso.cancel_time, |
| | | jso.paly_money |
| | | from jinhui_shopping_order as jso |
| | | LEFT JOIN sys_user su ON jso.user_id = su.user_id |
| | | LEFT JOIN jinhui_shopping js ON js.id = jso.goods_id |
| | | <where> |
| | | 1=1 |
| | | <if test="goodsId !=null and goodsId !='' "> |
| | | and jso.goods_id=#{goodsId} |
| | | </if> |
| | | <if test="orderNumber !=null and orderNumber !='' "> |
| | | and jso.order_number LIKE CONCAT('%', #{orderNumber}, '%') |
| | | </if> |
| | | <if test="goodName !=null and goodName !='' "> |
| | | and js.good_name LIKE CONCAT('%', #{goodName}, '%') |
| | | </if> |
| | | <if test="name !=null and name !='' "> |
| | | and su.name LIKE CONCAT('%', #{name}, '%') |
| | | </if> |
| | | <if test="cancelType !=null and cancelType !='' "> |
| | | and jso.cancel_type LIKE CONCAT('%', #{cancelType}, '%') |
| | | </if> |
| | | </where> |
| | | order by creation_time desc |
| | | </select> |
| | | |
| | | |
| | | <select id="getDetails" resultMap="itemMap"> |
| | | select |
| | | id, |
| | | order_number, |
| | | goods_id, |
| | | user_id, |
| | | creation_time, |
| | | cancel_type, |
| | | update_time, |
| | | cancel_time, |
| | | paly_money |
| | | from jinhui_shopping_order |
| | | where |
| | | id=#{id} |
| | | </select> |
| | | |
| | | <insert id="addData"> |
| | | insert into jinhui_shopping_order |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="item.id != null and item.id != '' "> |
| | | id, |
| | | </if> |
| | | <if test="item.orderNumber != null and item.orderNumber != '' "> |
| | | order_number, |
| | | </if> |
| | | <if test="item.goodsId != null and item.goodsId != '' "> |
| | | goods_id, |
| | | </if> |
| | | <if test="item.userId != null and item.userId != '' "> |
| | | user_id, |
| | | </if> |
| | | <if test="item.cancelType != null and item.cancelType != '' "> |
| | | cancel_type, |
| | | </if> |
| | | <if test="item.cancelTime != null and item.cancelTime != '' "> |
| | | cancel_time, |
| | | </if> |
| | | <if test="item.palyMoney != null and item.palyMoney != '' "> |
| | | paly_money, |
| | | </if> |
| | | creation_time |
| | | </trim> |
| | | values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="item.id != null and item.id != '' "> |
| | | #{item.id}, |
| | | </if> |
| | | <if test="item.orderNumber != null and item.orderNumber != '' "> |
| | | #{item.orderNumber}, |
| | | </if> |
| | | <if test="item.goodsId != null and item.goodsId != '' "> |
| | | #{item.goodsId}, |
| | | </if> |
| | | <if test="item.userId != null and item.userId != '' "> |
| | | #{item.userId}, |
| | | </if> |
| | | <if test="item.cancelType != null and item.cancelType != '' "> |
| | | #{item.cancelType}, |
| | | </if> |
| | | <if test="item.cancelTime != null and item.cancelTime != '' "> |
| | | #{item.cancelTime}, |
| | | </if> |
| | | <if test="item.palyMoney != null and item.palyMoney != '' "> |
| | | #{item.palyMoney}, |
| | | </if> |
| | | sysdate() |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="editData"> |
| | | update jinhui_shopping_order |
| | | <set> |
| | | <if test="item.id != null and item.id != '' "> |
| | | id=#{item.id}, |
| | | </if> |
| | | <if test="item.orderNumber != null and item.orderNumber != '' "> |
| | | order_number=#{item.orderNumber}, |
| | | </if> |
| | | <if test="item.goodsId != null and item.goodsId != '' "> |
| | | goods_id=#{item.goodsId}, |
| | | </if> |
| | | <if test="item.userId != null and item.userId != '' "> |
| | | user_id=#{item.userId}, |
| | | </if> |
| | | <if test="item.cancelType != null and item.cancelType != '' "> |
| | | cancel_type=#{item.cancelType}, |
| | | </if> |
| | | <if test="item.cancelTime != null and item.cancelTime != '' "> |
| | | cancel_time=#{item.cancelTime}, |
| | | </if> |
| | | <if test="item.palyMoney != null and item.palyMoney != '' "> |
| | | paly_money=#{item.palyMoney}, |
| | | </if> |
| | | update_time=sysdate() |
| | | </set> |
| | | where id = #{item.id} |
| | | </update> |
| | | |
| | | <delete id="expurgateData" parameterType="String"> |
| | | delete from jinhui_shopping_order where id=#{id} |
| | | </delete> |
| | | |
| | | </mapper> |