Commit c0ce1a0b by 吕明尚

修改管理系统SQL

parent 3cf47103
......@@ -10,6 +10,7 @@ import share.common.core.page.TableDataInfo;
import share.common.enums.BusinessType;
import share.common.utils.poi.ExcelUtil;
import share.system.domain.ConsumerWallet;
import share.system.domain.vo.ConsumerWalletVo;
import share.system.service.ConsumerWalletService;
import javax.servlet.http.HttpServletResponse;
......@@ -32,9 +33,9 @@ public class ConsumerWalletController extends BaseController {
*/
@PreAuthorize("@ss.hasPermi('system:wallet:list')")
@GetMapping("/list")
public TableDataInfo list(ConsumerWallet consumerWallet) {
public TableDataInfo list(ConsumerWalletVo consumerWallet) {
startPage();
List<ConsumerWallet> list = consumerWalletService.selectConsumerWalletList(consumerWallet);
List<ConsumerWalletVo> list = consumerWalletService.selectConsumerWalletList(consumerWallet);
return getDataTable(list);
}
......@@ -44,9 +45,9 @@ public class ConsumerWalletController extends BaseController {
@PreAuthorize("@ss.hasPermi('system:wallet:export')")
@Log(title = "会员钱包", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ConsumerWallet consumerWallet) {
List<ConsumerWallet> list = consumerWalletService.selectConsumerWalletList(consumerWallet);
ExcelUtil<ConsumerWallet> util = new ExcelUtil<ConsumerWallet>(ConsumerWallet.class);
public void export(HttpServletResponse response, ConsumerWalletVo consumerWallet) {
List<ConsumerWalletVo> list = consumerWalletService.selectConsumerWalletList(consumerWallet);
ExcelUtil<ConsumerWalletVo> util = new ExcelUtil<ConsumerWalletVo>(ConsumerWalletVo.class);
util.exportExcel(response, list, "会员钱包数据");
}
......
......@@ -10,6 +10,7 @@ import share.common.core.page.TableDataInfo;
import share.common.enums.BusinessType;
import share.common.utils.poi.ExcelUtil;
import share.system.domain.EquityMembersOrder;
import share.system.domain.vo.EquityMembersOrderVo;
import share.system.service.EquityMembersOrderService;
import javax.servlet.http.HttpServletResponse;
......@@ -32,9 +33,9 @@ public class EquityMembersOrderController extends BaseController {
*/
@PreAuthorize("@ss.hasPermi('system:equityMembersOrder:list')")
@GetMapping("/list")
public TableDataInfo list(EquityMembersOrder equityMembersOrder) {
public TableDataInfo list(EquityMembersOrderVo equityMembersOrder) {
startPage();
List<EquityMembersOrder> list = equityMembersOrderService.selectEquityMembersOrderList(equityMembersOrder);
List<EquityMembersOrderVo> list = equityMembersOrderService.selectEquityMembersOrderList(equityMembersOrder);
return getDataTable(list);
}
......@@ -44,9 +45,9 @@ public class EquityMembersOrderController extends BaseController {
@PreAuthorize("@ss.hasPermi('system:equityMembersOrder:export')")
@Log(title = "权益会员订单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, EquityMembersOrder equityMembersOrder) {
List<EquityMembersOrder> list = equityMembersOrderService.selectEquityMembersOrderList(equityMembersOrder);
ExcelUtil<EquityMembersOrder> util = new ExcelUtil<EquityMembersOrder>(EquityMembersOrder.class);
public void export(HttpServletResponse response, EquityMembersOrderVo equityMembersOrder) {
List<EquityMembersOrderVo> list = equityMembersOrderService.selectEquityMembersOrderList(equityMembersOrder);
ExcelUtil<EquityMembersOrderVo> util = new ExcelUtil<EquityMembersOrderVo>(EquityMembersOrderVo.class);
util.exportExcel(response, list, "权益会员订单数据");
}
......
......@@ -34,6 +34,12 @@ public class EquityMembersOrder extends BaseEntity {
private String equityOrderNo;
/**
* 用户id
*/
@Excel(name = "用户id")
private Long consumerId;
/**
* 订单金额
*/
@Excel(name = "订单金额")
......@@ -60,7 +66,7 @@ public class EquityMembersOrder extends BaseEntity {
/**
* 商户订单号
*/
@Excel(name = "商户订单号")
@Excel(name = "终端流水号")
private String terminalTrace;
/**
......
package share.system.domain.vo;
import lombok.Data;
import share.system.domain.ConsumerWallet;
@Data
public class ConsumerWalletVo extends ConsumerWallet {
private String nickName;
private String avatar;
/**
* 用户手机号
*/
private String phone;
}
package share.system.domain.vo;
import lombok.Data;
import share.system.domain.EquityMembersOrder;
@Data
public class EquityMembersOrderVo extends EquityMembersOrder {
private String nickName;
private String avatar;
/**
* 用户手机号
*/
private String phone;
}
......@@ -27,7 +27,7 @@ public interface ConsumerMemberMapper extends BaseMapper<ConsumerMember> {
* @param consumerMember 会员用户
* @return 会员用户集合
*/
public List<ConsumerMember> selectConsumerMemberList(ConsumerMemberVo consumerMember);
public List<ConsumerMemberVo> selectConsumerMemberList(ConsumerMemberVo consumerMember);
/**
* 新增会员用户
......
......@@ -2,6 +2,7 @@ package share.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import share.system.domain.ConsumerWallet;
import share.system.domain.vo.ConsumerWalletVo;
import java.util.List;
......@@ -26,7 +27,7 @@ public interface ConsumerWalletMapper extends BaseMapper<ConsumerWallet> {
* @param consumerWallet 会员钱包
* @return 会员钱包集合
*/
public List<ConsumerWallet> selectConsumerWalletList(ConsumerWallet consumerWallet);
public List<ConsumerWalletVo> selectConsumerWalletList(ConsumerWalletVo consumerWallet);
/**
* 新增会员钱包
......
......@@ -2,6 +2,7 @@ package share.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import share.system.domain.EquityMembersOrder;
import share.system.domain.vo.EquityMembersOrderVo;
import java.util.List;
......@@ -26,7 +27,7 @@ public interface EquityMembersOrderMapper extends BaseMapper<EquityMembersOrder>
* @param equityMembersOrder 权益会员订单
* @return 权益会员订单集合
*/
public List<EquityMembersOrder> selectEquityMembersOrderList(EquityMembersOrder equityMembersOrder);
public List<EquityMembersOrderVo> selectEquityMembersOrderList(EquityMembersOrderVo equityMembersOrder);
/**
* 新增权益会员订单
......
......@@ -2,6 +2,7 @@ package share.system.service;
import com.baomidou.mybatisplus.extension.service.IService;
import share.system.domain.ConsumerWallet;
import share.system.domain.vo.ConsumerWalletVo;
import java.util.List;
......@@ -26,7 +27,7 @@ public interface ConsumerWalletService extends IService<ConsumerWallet> {
* @param consumerWallet 会员钱包
* @return 会员钱包集合
*/
public List<ConsumerWallet> selectConsumerWalletList(ConsumerWallet consumerWallet);
public List<ConsumerWalletVo> selectConsumerWalletList(ConsumerWalletVo consumerWallet);
/**
* 新增会员钱包
......
......@@ -2,6 +2,7 @@ package share.system.service;
import com.baomidou.mybatisplus.extension.service.IService;
import share.system.domain.EquityMembersOrder;
import share.system.domain.vo.EquityMembersOrderVo;
import java.util.List;
......@@ -26,7 +27,7 @@ public interface EquityMembersOrderService extends IService<EquityMembersOrder>
* @param equityMembersOrder 权益会员订单
* @return 权益会员订单集合
*/
public List<EquityMembersOrder> selectEquityMembersOrderList(EquityMembersOrder equityMembersOrder);
public List<EquityMembersOrderVo> selectEquityMembersOrderList(EquityMembersOrderVo equityMembersOrder);
/**
* 新增权益会员订单
......
package share.system.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import share.common.utils.DateUtils;
import share.system.domain.ConsumerMember;
import share.system.domain.SConsumer;
import share.system.domain.vo.ConsumerMemberVo;
import share.system.mapper.ConsumerMemberMapper;
import share.system.service.ConsumerMemberService;
import share.system.service.SConsumerService;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 会员用户Service业务层处理
......@@ -51,23 +44,7 @@ public class ConsumerMemberServiceImpl extends ServiceImpl<ConsumerMemberMapper,
*/
@Override
public List<ConsumerMemberVo> selectConsumerMemberList(ConsumerMemberVo consumerMember) {
List<ConsumerMember> consumerMembers = consumerMemberMapper.selectConsumerMemberList(consumerMember);
Map<Long, SConsumer> sConsumerMap = sConsumerService.list().stream().collect(Collectors.toMap(SConsumer::getId, s -> s));
List<ConsumerMemberVo> voList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(consumerMembers)) {
consumerMembers.stream().forEach(o -> {
ConsumerMemberVo vo = new ConsumerMemberVo();
BeanUtils.copyProperties(o, vo);
SConsumer sConsumer = sConsumerMap.get(o.getConsumerId());
if (ObjectUtil.isNotEmpty(sConsumer)) {
vo.setPhone(sConsumer.getPhone());
vo.setNickName(sConsumer.getNickName());
vo.setAvatar(sConsumer.getAvatar());
}
voList.add(vo);
});
}
return voList;
return consumerMemberMapper.selectConsumerMemberList(consumerMember);
}
/**
......
......@@ -5,6 +5,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import share.common.utils.DateUtils;
import share.system.domain.ConsumerWallet;
import share.system.domain.vo.ConsumerWalletVo;
import share.system.mapper.ConsumerWalletMapper;
import share.system.service.ConsumerWalletService;
......@@ -39,7 +40,7 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper,
* @return 会员钱包
*/
@Override
public List<ConsumerWallet> selectConsumerWalletList(ConsumerWallet consumerWallet) {
public List<ConsumerWalletVo> selectConsumerWalletList(ConsumerWalletVo consumerWallet) {
return consumerWalletMapper.selectConsumerWalletList(consumerWallet);
}
......
......@@ -5,6 +5,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import share.common.utils.DateUtils;
import share.system.domain.EquityMembersOrder;
import share.system.domain.vo.EquityMembersOrderVo;
import share.system.mapper.EquityMembersOrderMapper;
import share.system.service.EquityMembersOrderService;
......@@ -39,7 +40,7 @@ public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrde
* @return 权益会员订单
*/
@Override
public List<EquityMembersOrder> selectEquityMembersOrderList(EquityMembersOrder equityMembersOrder) {
public List<EquityMembersOrderVo> selectEquityMembersOrderList(EquityMembersOrderVo equityMembersOrder) {
return equityMembersOrderMapper.selectEquityMembersOrderList(equityMembersOrder);
}
......
......@@ -4,9 +4,12 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="share.system.mapper.ConsumerMemberMapper">
<resultMap type="ConsumerMember" id="ConsumerMemberResult">
<resultMap type="ConsumerMemberVo" id="ConsumerMemberResult">
<result property="id" column="id"/>
<result property="consumerId" column="consumer_id"/>
<result property="nickName" column="nick_name"/>
<result property="phone" column="phone"/>
<result property="avatar" column="avatar"/>
<result property="membershipLevel" column="membership_level"/>
<result property="memberType" column="member_type"/>
<result property="memberConfigId" column="member_config_id"/>
......@@ -40,6 +43,9 @@
<select id="selectConsumerMemberList" parameterType="ConsumerMemberVo" resultMap="ConsumerMemberResult">
select m.id,
m.consumer_id,
c.nick_name,
c.phone,
c.avatar,
m. membership_level,
m.member_type,
m.member_config_id,
......
......@@ -4,9 +4,12 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="share.system.mapper.ConsumerWalletMapper">
<resultMap type="ConsumerWallet" id="ConsumerWalletResult">
<resultMap type="ConsumerWalletVo" id="ConsumerWalletResult">
<result property="id" column="id"/>
<result property="consumerId" column="consumer_id"/>
<result property="nickName" column="nick_name"/>
<result property="avatar" column="avatar"/>
<result property="phone" column="phone"/>
<result property="balance" column="balance"/>
<result property="remainingDuration" column="remaining_duration"/>
<result property="remainingIntegral" column="remaining_integral"/>
......@@ -33,14 +36,32 @@
from s_consumer_wallet
</sql>
<select id="selectConsumerWalletList" parameterType="ConsumerWallet" resultMap="ConsumerWalletResult">
<include refid="selectConsumerWalletVo"/>
<select id="selectConsumerWalletList" parameterType="ConsumerWalletVo" resultMap="ConsumerWalletResult">
select w.id,
w.consumer_id,
c.nick_name,
c.phone,
c.avatar,
w.balance,
w.remaining_duration,
w.remaining_integral,
w.is_delete,
w.create_by,
w.create_time,
w.update_by,
w.update_time,
w.remark
from s_consumer_wallet w join s_consumer c on w.consumer_id = c.id
<where>
<if test="consumerId != null ">and consumer_id = #{consumerId}</if>
<if test="balance != null ">and balance = #{balance}</if>
<if test="remainingDuration != null ">and remaining_duration = #{remainingDuration}</if>
<if test="remainingIntegral != null ">and remaining_integral = #{remainingIntegral}</if>
<if test="isDelete != null ">and is_delete = #{isDelete}</if>
<if test="nickName != null and nickName != ''">and c.nick_name like concat('%', #{nickName},'%')
</if>
<if test="phone != null and phone != ''">and c.phone like concat('%', #{phone},'%')
</if>
<if test="consumerId != null ">and w.consumer_id = #{consumerId}</if>
<if test="balance != null ">and w.balance = #{balance}</if>
<if test="remainingDuration != null ">and w.remaining_duration = #{remainingDuration}</if>
<if test="remainingIntegral != null ">and w.remaining_integral = #{remainingIntegral}</if>
<if test="isDelete != null ">and w.is_delete = #{isDelete}</if>
</where>
</select>
......
......@@ -4,9 +4,13 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="share.system.mapper.EquityMembersOrderMapper">
<resultMap type="EquityMembersOrder" id="EquityMembersOrderResult">
<resultMap type="EquityMembersOrderVo" id="EquityMembersOrderResult">
<result property="id" column="id"/>
<result property="equityOrderNo" column="equity_order_no"/>
<result property="consumerId" column="consumer_id"/>
<result property="nickName" column="nick_name"/>
<result property="phone" column="phone"/>
<result property="avatar" column="avatar"/>
<result property="payPrice" column="pay_price"/>
<result property="equityMembersConfigId" column="equity_members_config_id"/>
<result property="payType" column="pay_type"/>
......@@ -25,6 +29,7 @@
<sql id="selectEquityMembersOrderVo">
select id,
equity_order_no,
consumer_id,
pay_price,
equity_members_config_id,
pay_type,
......@@ -41,18 +46,42 @@
from s_equity_members_order
</sql>
<select id="selectEquityMembersOrderList" parameterType="EquityMembersOrder" resultMap="EquityMembersOrderResult">
<include refid="selectEquityMembersOrderVo"/>
<select id="selectEquityMembersOrderList" parameterType="EquityMembersOrderVo" resultMap="EquityMembersOrderResult">
select o.id,
o.equity_order_no,
c.nick_name,
c.phone,
c.avatar,
o.consumer_id,
o.pay_price,
o.equity_members_config_id,
o.pay_type,
o.out_trade_no,
o.terminal_trace,
o.pay_status,
o. pay_time,
o.is_delete,
o.create_by,
o. create_time,
o. update_by,
o. update_time,
o. remark
from s_equity_members_order o join s_consumer c on o.consumer_id = c.id
<where>
<if test="equityOrderNo != null and equityOrderNo != ''">and equity_order_no = #{equityOrderNo}</if>
<if test="payPrice != null ">and pay_price = #{payPrice}</if>
<if test="equityMembersConfigId != null ">and equity_members_config_id = #{equityMembersConfigId}</if>
<if test="payType != null ">and pay_type = #{payType}</if>
<if test="outTradeNo != null and outTradeNo != ''">and out_trade_no = #{outTradeNo}</if>
<if test="terminalTrace != null and terminalTrace != ''">and terminal_trace = #{terminalTrace}</if>
<if test="payStatus != null ">and pay_status = #{payStatus}</if>
<if test="payTime != null ">and pay_time = #{payTime}</if>
<if test="isDelete != null ">and is_delete = #{isDelete}</if>
<if test="nickName != null and nickName != ''">and c.nick_name like concat('%', #{nickName},'%')
</if>
<if test="phone != null and phone != ''">and c.phone like concat('%', #{phone},'%')
</if>
<if test="equityOrderNo != null and equityOrderNo != ''">and o.equity_order_no = #{equityOrderNo}</if>
<if test="consumerId != null ">and o.consumer_id = #{consumerId}</if>
<if test="payPrice != null ">and o.pay_price = #{payPrice}</if>
<if test="equityMembersConfigId != null ">and o.equity_members_config_id = #{equityMembersConfigId}</if>
<if test="payType != null ">and o.pay_type = #{payType}</if>
<if test="outTradeNo != null and outTradeNo != ''">and o.out_trade_no = #{outTradeNo}</if>
<if test="terminalTrace != null and terminalTrace != ''">and o.terminal_trace = #{terminalTrace}</if>
<if test="payStatus != null ">and o.pay_status = #{payStatus}</if>
<if test="payTime != null ">and o.pay_time = #{payTime}</if>
<if test="isDelete != null ">and o.is_delete = #{isDelete}</if>
</where>
</select>
......@@ -65,6 +94,7 @@
insert into s_equity_members_order
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="equityOrderNo != null and equityOrderNo != ''">equity_order_no,</if>
<if test="consumerId != null">consumer_id,</if>
<if test="payPrice != null">pay_price,</if>
<if test="equityMembersConfigId != null">equity_members_config_id,</if>
<if test="payType != null">pay_type,</if>
......@@ -81,6 +111,7 @@
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="equityOrderNo != null and equityOrderNo != ''">#{equityOrderNo},</if>
<if test="consumerId != null">#{consumerId},</if>
<if test="payPrice != null">#{payPrice},</if>
<if test="equityMembersConfigId != null">#{equityMembersConfigId},</if>
<if test="payType != null">#{payType},</if>
......@@ -101,6 +132,7 @@
update s_equity_members_order
<trim prefix="SET" suffixOverrides=",">
<if test="equityOrderNo != null and equityOrderNo != ''">equity_order_no = #{equityOrderNo},</if>
<if test="consumerId != null">consumer_id = #{consumerId},</if>"
<if test="payPrice != null">pay_price = #{payPrice},</if>
<if test="equityMembersConfigId != null">equity_members_config_id = #{equityMembersConfigId},</if>
<if test="payType != null">pay_type = #{payType},</if>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment