记得上下班打卡 | git大法好,push需谨慎

Commit d7af8191 authored by limingyang's avatar limingyang

商城订单信息追加行导出 goblin

parent 64a35726
...@@ -4,9 +4,10 @@ import com.liquidnet.client.admin.common.core.controller.BaseController; ...@@ -4,9 +4,10 @@ import com.liquidnet.client.admin.common.core.controller.BaseController;
import com.liquidnet.client.admin.common.core.domain.AjaxResult; import com.liquidnet.client.admin.common.core.domain.AjaxResult;
import com.liquidnet.client.admin.common.exception.BusinessException; import com.liquidnet.client.admin.common.exception.BusinessException;
import com.liquidnet.client.admin.common.utils.poi.ExcelUtil; import com.liquidnet.client.admin.common.utils.poi.ExcelUtil;
import com.liquidnet.client.admin.zhengzai.goblin.service.IGoblinExportService;
import com.liquidnet.client.admin.zhengzai.kylin.dto.*; import com.liquidnet.client.admin.zhengzai.kylin.dto.*;
import com.liquidnet.client.admin.zhengzai.kylin.service.IExportService; import com.liquidnet.client.admin.zhengzai.kylin.service.IExportService;
import com.liquidnet.service.kylin.dao.MallOrdertDao; import com.liquidnet.service.goblin.dto.MallOrdertDao;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.poi.xssf.usermodel.*; import org.apache.poi.xssf.usermodel.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -25,11 +26,13 @@ import java.util.*; ...@@ -25,11 +26,13 @@ import java.util.*;
@RequestMapping("tools/export") @RequestMapping("tools/export")
public class ExportDataController extends BaseController { public class ExportDataController extends BaseController {
private static ExcelUtil<Object> excelUtil;
@Autowired @Autowired
private IExportService exportService; private IExportService exportService;
@Autowired
private IGoblinExportService iGoblinExportService;
private String prefix = "zhengzai/financial"; private String prefix = "zhengzai/financial";
@GetMapping() @GetMapping()
...@@ -87,186 +90,6 @@ public class ExportDataController extends BaseController { ...@@ -87,186 +90,6 @@ public class ExportDataController extends BaseController {
return StringUtils.isNotBlank(beginTime) && StringUtils.isNotBlank(endTime) ? true : false; return StringUtils.isNotBlank(beginTime) && StringUtils.isNotBlank(endTime) ? true : false;
} }
/**
* 导出商城订单信息
*
* @param beginTime
* @param endTime
* @return
*/
@PostMapping("/export/exportMallOrder")
@ResponseBody
public AjaxResult exportMallOrder(String beginTime, String endTime, String state, Integer mailType) {
if (!timeIsNotNull(beginTime, endTime)) {
return error("开始时间和结束时间不能为空!");
}
List<MallOrdertDao> voList = exportService.exportMallOrder(beginTime, endTime, state ,mailType);
AjaxResult ajaxResult = null;
Map<String, List<String>> map = new HashMap<>();
int max = 0;
//将数据保存到list中
if (voList != null && voList.size() > 0) {
for (MallOrdertDao te : voList) {
String orderCode = te.getOrderCode();
if (map.get(orderCode) == null) {
List<String> list = new ArrayList<>();
list.add(te.getOrderCode());
list.add(te.getUserMobile());
list.add(te.getPriceExpress());
list.add(te.getPriceCoupon());
list.add(te.getStorePriceCoupon());
list.add(te.getExpressContacts());
list.add(te.getExpressPhone());
list.add(te.getExpressDetailAddress());
list.add(te.getPayType());
list.add(te.getPayTime());
list.add(te.getCreatedAt());
list.add(te.getLogisticsCompany());
list.add(te.getMailNo());
list.add(te.getSpuId());
list.add(te.getName());
list.add(te.getCate1Name());
list.add(te.getCate2Name());
list.add(te.getSkuName());
list.add(te.getNum());
list.add(te.getSkuPrice());
list.add(te.getSkuPriceActual());
max = Math.max(max, list.size());
map.put(orderCode, list);
}
if (map.get(orderCode) != null) {
List<String> list = map.get(orderCode);
list.add(te.getSpuId());
list.add(te.getName());
list.add(te.getCate1Name());
list.add(te.getCate2Name());
list.add(te.getSkuName());
list.add(te.getNum());
list.add(te.getSkuPrice());
list.add(te.getSkuPriceActual());
list.add(te.getOrderSkuId());
max = Math.max(max, list.size());
map.put(orderCode, list);
}
}
ajaxResult = exportexcel(map, "order", max);
}
if (voList.size() == 0) {
return error("查无信息");
}
return ajaxResult;
}
private AjaxResult exportexcel(Map<String, List<String>> map, String name, int max) {
//实例化XSSFWorkbook对象,相当于新建一个Excel文件
XSSFWorkbook workbook = new XSSFWorkbook();
//根据XSSFWorkbook获取Sheet
XSSFSheet sheet = workbook.createSheet();
//添加一行作为表格头
XSSFRow header = sheet.createRow(0);
//创建表格样式
XSSFCellStyle cellStyle = workbook.createCellStyle();
//cellStyle.setAlignment(CellStyle.ALIGN_CENTER);//内容居中显示
//创建头部表格
XSSFCell cell = header.createCell(0);
cell.setCellStyle(cellStyle);
cell.setCellValue("订单编号");
int index = 0;
//固定表头
List<String> fixedCells = fixedCells();
for (String cname : fixedCells) {
index++;
cell = header.createCell(index);
cell.setCellStyle(cellStyle);
cell.setCellValue(cname);
}
int n = 13; //固定表头13个
int indext = 0;
//追加表头
List<String> cells = appendCells();
while (n < max) {
indext++;
for (String cname : cells) {
cell = header.createCell(n);
cell.setCellStyle(cellStyle);
cell.setCellValue(cname + indext);
n++;
}
}
int z = 1;
for (Map.Entry<String, List<String>> entry : map.entrySet()) {
List<String> list = entry.getValue();
//获取每行
XSSFRow content = sheet.createRow(z);
for (int i = 0; i < list.size(); i++) {
//创建单元格并设置值
content.createCell(i).setCellValue(list.get(i));
}
z++;
}
OutputStream fileOutputStream = null;
try {
ExcelUtil<MallOrdertDao> util = new ExcelUtil(MallOrdertDao.class);
String filename = util.encodingFilename(name);
//写入文件
fileOutputStream = new FileOutputStream(util.getAbsoluteFile(filename));
workbook.write(fileOutputStream);
return AjaxResult.success(filename);
} catch (IOException e) {
e.printStackTrace();
throw new BusinessException("导出Excel失败,请联系网站管理员!");
} finally {
if (workbook != null) {
try {
workbook.close();
} catch (IOException e) {
e.printStackTrace();
}
}
if (fileOutputStream != null) {
try {
fileOutputStream.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
//固定表头
private List<String> fixedCells() {
List<String> cells = new ArrayList<>();
cells.add("购买人手机号");
cells.add("快递费");
cells.add("平台券优惠券金额");
cells.add("店铺券优惠金额");
cells.add("收货人");
cells.add("收货人电话");
cells.add("快递地址");
cells.add("支付方式");
cells.add("支付时间");
cells.add("下单时间");
cells.add("快递公司");
cells.add("物流单号");
return cells;
}
//追加表头
private List<String> appendCells() {
List<String> cells = new ArrayList<>();
cells.add("商品id");
cells.add("商品名");
cells.add("一级分类");
cells.add("二级分类");
cells.add("款式");
cells.add("数量");
cells.add("单价");
cells.add("价格");
cells.add("订单skuId");
return cells;
}
/** /**
* 导出会员订单 * 导出会员订单
...@@ -310,4 +133,21 @@ public class ExportDataController extends BaseController { ...@@ -310,4 +133,21 @@ public class ExportDataController extends BaseController {
return util.exportExcel(list, "商品订单"); return util.exportExcel(list, "商品订单");
} }
/**
* 导出商城订单信息
*
* @param beginTime
* @param endTime
* @return
*/
@PostMapping("/export/exportMallOrder")
@ResponseBody
public AjaxResult exportMallOrder(String beginTime, String endTime, String state, Integer mailType) {
if (!timeIsNotNull(beginTime, endTime)) { //todo 暂定只校验时间
return error("开始时间和结束时间不能为空!");
}
AjaxResult ajaxResult = iGoblinExportService.exportMallOrder(beginTime, endTime, state, mailType);
return ajaxResult;
}
} }
package com.liquidnet.client.admin.zhengzai.goblin.service;
import com.liquidnet.client.admin.common.core.domain.AjaxResult;
import com.liquidnet.service.goblin.dto.MallOrdertDao;
import java.util.List;
public interface IGoblinExportService {
//导出商城订单信息
AjaxResult exportMallOrder(String beginTime, String endTime, String state, Integer mailType);
}
package com.liquidnet.client.admin.zhengzai.goblin.service.impl;
import com.liquidnet.client.admin.common.core.domain.AjaxResult;
import com.liquidnet.client.admin.common.exception.BusinessException;
import com.liquidnet.client.admin.common.utils.poi.ExcelUtil;
import com.liquidnet.client.admin.zhengzai.goblin.service.IGoblinExportService;
import com.liquidnet.service.goblin.dto.MallOrdertDao;
import com.liquidnet.service.goblin.mapper.GoblinStoreOrderMapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.xssf.usermodel.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
@Service
@Slf4j
public class GoblinExportServiceImpl implements IGoblinExportService {
@Autowired
GoblinStoreOrderMapper goblinStoreOrderMapper;
@Override
public AjaxResult exportMallOrder(String beginTime, String endTime, String state, Integer mailType) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
Date beginDate = sdf.parse(beginTime);
Date endDate = sdf.parse(endTime);
List<String> states = null;
if (StringUtils.isNotBlank(state)) {
states = Arrays.asList(state.split(","));
}
List<MallOrdertDao> voList = goblinStoreOrderMapper.exportMallOrder(beginDate, endDate, states ,mailType);
AjaxResult ajaxResult = null;
Map<String, List<String>> map = new HashMap<>();
int max = 0;
//将数据保存到list中
if (voList != null && voList.size() > 0) {
for (MallOrdertDao te : voList) {
String orderCode = te.getOrderCode();
if (map.get(orderCode) == null) {
List<String> list = new ArrayList<>();
list.add(te.getOrderCode());
list.add(te.getUserMobile());
list.add(te.getPriceExpress());
list.add(te.getPriceCoupon());
list.add(te.getStorePriceCoupon());
list.add(te.getExpressContacts());
list.add(te.getExpressPhone());
list.add(te.getExpressDetailAddress());
list.add(te.getPayType());
list.add(te.getPayTime());
list.add(te.getCreatedAt());
list.add(te.getLogisticsCompany());
list.add(te.getMailNo());
list.add(te.getSpuId());
list.add(te.getName());
list.add(te.getCate1Name());
list.add(te.getCate2Name());
list.add(te.getSkuName());
list.add(te.getNum());
list.add(te.getSkuPrice());
list.add(te.getSkuPriceActual());
list.add(te.getOrderSkuId());
max = Math.max(max, list.size());
map.put(orderCode, list);
continue;
}
if (map.get(orderCode) != null) {
List<String> list = map.get(orderCode);
list.add(te.getSpuId());
list.add(te.getName());
list.add(te.getCate1Name());
list.add(te.getCate2Name());
list.add(te.getSkuName());
list.add(te.getNum());
list.add(te.getSkuPrice());
list.add(te.getSkuPriceActual());
list.add(te.getOrderSkuId());
max = Math.max(max, list.size());
map.put(orderCode, list);
}
}
return exportexcel(map, "order", max);
}
return AjaxResult.error("查无信息!");
} catch (ParseException e) {
e.printStackTrace();
throw new BusinessException("导出Excel失败,请联系网站管理员!");
}
}
//导出Excel
private AjaxResult exportexcel(Map<String, List<String>> map, String name, int max) {
//实例化XSSFWorkbook对象,相当于新建一个Excel文件
XSSFWorkbook workbook = new XSSFWorkbook();
//根据XSSFWorkbook获取Sheet
XSSFSheet sheet = workbook.createSheet();
//添加一行作为表格头
XSSFRow header = sheet.createRow(0);
//创建表格样式
XSSFCellStyle cellStyle = workbook.createCellStyle();
//cellStyle.setAlignment(CellStyle.ALIGN_CENTER);//内容居中显示
//创建头部表格
XSSFCell cell = null;
int index = 0;
//固定表头
List<String> fixedCells = fixedCells();
for (String cname : fixedCells) {
cell = header.createCell(index);
cell.setCellStyle(cellStyle);
cell.setCellValue(cname);
index++;
}
int n = 13; //固定表头13个
int indext = 0;
//追加表头
List<String> cells = appendCells();
while (n < max) {
indext++;
for (String cname : cells) {
cell = header.createCell(n);
cell.setCellStyle(cellStyle);
cell.setCellValue(cname + indext);
n++;
}
}
int z = 1;
for (Map.Entry<String, List<String>> entry : map.entrySet()) {
List<String> list = entry.getValue();
//获取每行
XSSFRow content = sheet.createRow(z);
for (int i = 0; i < list.size(); i++) {
//创建单元格并设置值
content.createCell(i).setCellValue(list.get(i));
}
z++;
}
OutputStream fileOutputStream = null;
try {
ExcelUtil<MallOrdertDao> util = new ExcelUtil(MallOrdertDao.class);
String filename = util.encodingFilename(name);
//写入文件
fileOutputStream = new FileOutputStream(util.getAbsoluteFile(filename));
workbook.write(fileOutputStream);
return AjaxResult.success("导出成功!",filename);
} catch (IOException e) {
e.printStackTrace();
throw new BusinessException("导出Excel失败,请联系网站管理员!");
} finally {
if (workbook != null) {
try {
workbook.close();
} catch (IOException e) {
e.printStackTrace();
}
}
if (fileOutputStream != null) {
try {
fileOutputStream.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
//固定表头
private List<String> fixedCells() {
List<String> cells = new ArrayList<>();
cells.add("订单编号");
cells.add("购买人手机号");
cells.add("快递费");
cells.add("平台券优惠券金额");
cells.add("店铺券优惠金额");
cells.add("收货人");
cells.add("收货人电话");
cells.add("快递地址");
cells.add("支付方式");
cells.add("支付时间");
cells.add("下单时间");
cells.add("快递公司");
cells.add("物流单号");
return cells;
}
//追加表头
private List<String> appendCells() {
List<String> cells = new ArrayList<>();
cells.add("商品id");
cells.add("商品名");
cells.add("一级分类");
cells.add("二级分类");
cells.add("款式");
cells.add("数量");
cells.add("单价");
cells.add("价格");
cells.add("订单skuId");
return cells;
}
}
package com.liquidnet.client.admin.zhengzai.kylin.service; package com.liquidnet.client.admin.zhengzai.kylin.service;
import com.liquidnet.client.admin.zhengzai.kylin.dto.*; import com.liquidnet.client.admin.zhengzai.kylin.dto.*;
import com.liquidnet.service.kylin.dao.MallOrdertDao;
import java.util.List; import java.util.List;
...@@ -23,8 +22,6 @@ public interface IExportService { ...@@ -23,8 +22,6 @@ public interface IExportService {
//导出会员订单信息 //导出会员订单信息
List<OrderMemberExportVo> exportMemberOrder(String beginTime, String endTime); List<OrderMemberExportVo> exportMemberOrder(String beginTime, String endTime);
List<MallOrdertDao> exportMallOrder(String beginTime, String endTime, String state, Integer mailType);
//导出商品订单信息 //导出商品订单信息
List<OrderCommodityExportVo> exportCommodityOrder(String beginTime, String endTime); List<OrderCommodityExportVo> exportCommodityOrder(String beginTime, String endTime);
} }
...@@ -6,7 +6,6 @@ import com.liquidnet.client.admin.zhengzai.kylin.service.IExportService; ...@@ -6,7 +6,6 @@ import com.liquidnet.client.admin.zhengzai.kylin.service.IExportService;
import com.liquidnet.service.kylin.dao.CommodityOrderExportDao; import com.liquidnet.service.kylin.dao.CommodityOrderExportDao;
import com.liquidnet.service.kylin.dao.MemberOrderExportDao; import com.liquidnet.service.kylin.dao.MemberOrderExportDao;
import com.liquidnet.service.kylin.dao.OrderExportDao; import com.liquidnet.service.kylin.dao.OrderExportDao;
import com.liquidnet.service.kylin.dao.MallOrdertDao;
import com.liquidnet.service.kylin.mapper.KylinPerformancesMapper; import com.liquidnet.service.kylin.mapper.KylinPerformancesMapper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -110,21 +109,6 @@ public class ExportServiceImpl implements IExportService { ...@@ -110,21 +109,6 @@ public class ExportServiceImpl implements IExportService {
} }
} }
@Override
public List<MallOrdertDao> exportMallOrder(String beginTime, String endTime, String state, Integer mailType) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
Date beginDate = sdf.parse(beginTime);
Date endDate = sdf.parse(endTime);
List<String> states = Arrays.asList(state.split(","));
List<MallOrdertDao> list = performancesMapper.exportMallOrder(beginDate, endDate, states, mailType);
return list;
} catch (ParseException e) {
e.printStackTrace();
throw new BusinessException("导出Excel失败,请联系网站管理员!");
}
}
@Override @Override
public List<OrderCommodityExportVo> exportCommodityOrder(String beginTime, String endTime) { public List<OrderCommodityExportVo> exportCommodityOrder(String beginTime, String endTime) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
......
package com.liquidnet.service.goblin.mapper; package com.liquidnet.service.goblin.mapper;
import com.liquidnet.service.goblin.dto.MallOrdertDao;
import com.liquidnet.service.goblin.entity.GoblinStoreOrder; import com.liquidnet.service.goblin.entity.GoblinStoreOrder;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
/** /**
* <p> * <p>
...@@ -13,4 +18,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -13,4 +18,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/ */
public interface GoblinStoreOrderMapper extends BaseMapper<GoblinStoreOrder> { public interface GoblinStoreOrderMapper extends BaseMapper<GoblinStoreOrder> {
List<MallOrdertDao> exportMallOrder(@Param("beginTime") Date beginTime, @Param("endTime") Date endTime, @Param("states") List<String>
states, @Param("mailType") Integer mailType);
} }
...@@ -2,4 +2,80 @@ ...@@ -2,4 +2,80 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.liquidnet.service.goblin.mapper.GoblinStoreOrderMapper"> <mapper namespace="com.liquidnet.service.goblin.mapper.GoblinStoreOrderMapper">
<resultMap id="exportMallOrderDaoResult" type="com.liquidnet.service.goblin.dto.MallOrdertDao">
<result column="order_code" property="orderCode"/>
<result column="user_mobile" property="userMobile"/>
<result column="price_express" property="priceExpress"/>
<result column="price_coupon" property="priceCoupon"/>
<result column="store_price_coupon" property="storePriceCoupon"/>
<result column="express_contacts" property="expressContacts"/>
<result column="express_phone" property="expressPhone"/>
<result column="express_detail_address" property="expressDetailAddress"/>
<result column="spu_id" property="spuId"/>
<result column="name" property="name"/>
<result column="cate1_name" property="cate1Name"/>
<result column="cate2_name" property="cate2Name"/>
<result column="sku_name" property="skuName"/>
<result column="num" property="num"/>
<result column="sku_price" property="skuPrice"/>
<result column="sku_price_actual" property="skuPriceActual"/>
<result column="order_sku_id" property="orderSkuId"/>
<result column="pay_type" property="payType"/>
<result column="pay_time" property="payTime"/>
<result column="created_at" property="createdAt"/>
<result column="logistics_company" property="logisticsCompany"/>
<result column="mail_no" property="mailNo"/>
</resultMap>
<select id="exportMallOrder" resultMap="exportMallOrderDaoResult">
select gso.order_code as order_code,
gso.user_mobile as user_mobile,
gso.price_express as price_express,
gso.price_coupon as price_coupon,
gso.store_price_coupon as store_price_coupon,
goa.express_contacts as express_contacts,
goa.express_phone as express_phone,
CONCAT(goa.express_address,' ',goa.express_address_detail) as express_detail_address,
gso.pay_type as pay_type,
gso.pay_time as pay_time,
gso.created_at as created_at,
gm.logistics_company as logistics_company,
gm.mail_no as mail_no,
gos.spu_id as spu_id,
gg.name as name,
gg.cate1_name as cate1_name,
gg.cate2_name as cate2_name,
gos.sku_name as sku_name,
gos.num as num,
gos.sku_price as sku_price,
gos.sku_price_actual as sku_price_actual,
gos.order_sku_id as order_sku_id
from goblin_store_order as gso
inner join goblin_order_sku as gos on gos.order_id = gso.order_id
inner join (select spu_id, gg.name, gsgc1.name as cate1_name, gsgc2.name as cate2_name
from goblin_goods as gg
left join goblin_self_goods_category as gsgc1 on gsgc1.cate_id = gg.cate_fid
left join goblin_self_goods_category as gsgc2 on gsgc2.cate_id = gg.cate_sid) as gg
on gos.spu_id = gg.spu_id
inner join goblin_order_attr as goa on goa.order_id = gso.order_id
left join goblin_mail as gm on gm.order_id = gso.order_id
<where>
<if test="beginTime != null and endTime != null">
and gso.created_at between #{beginTime} and #{endTime}
</if>
<if test="states != null">
and gso.status in
<foreach collection="states" item="item" index="item" open="(" separator="," close=")">
${item}
</foreach>
</if>
<if test="mailType != null and mailType == '1'">
and gm.mail_no is null;
</if>
<if test="mailType != null and mailType == '2'">
and gm.mail_no is not null;
</if>
</where>
</select>
</mapper> </mapper>
...@@ -82,6 +82,4 @@ public interface KylinPerformancesMapper extends BaseMapper<KylinPerformances> { ...@@ -82,6 +82,4 @@ public interface KylinPerformancesMapper extends BaseMapper<KylinPerformances> {
//商品订单信息 //商品订单信息
List<CommodityOrderExportDao> exportCommodityOrder(@Param("beginTime") Date beginTime, @Param("endTime") Date endTime); List<CommodityOrderExportDao> exportCommodityOrder(@Param("beginTime") Date beginTime, @Param("endTime") Date endTime);
List<MallOrdertDao> exportMallOrder(@Param("beginTime") Date beginTime, @Param("endTime") Date endTime, @Param("states") List<String>
states, @Param("mailType") Integer mailType);
} }
...@@ -100,30 +100,6 @@ ...@@ -100,30 +100,6 @@
<result column="refund_at" property="refundAt"/> <result column="refund_at" property="refundAt"/>
</resultMap> </resultMap>
<resultMap id="testDaoResult" type="com.liquidnet.service.kylin.dao.MallOrdertDao">
<result column="order_code" property="orderCode"/>
<result column="user_mobile" property="userMobile"/>
<result column="price_express" property="priceExpress"/>
<result column="price_coupon" property="priceCoupon"/>
<result column="store_price_coupon" property="storePriceCoupon"/>
<result column="express_contacts" property="expressContacts"/>
<result column="express_phone" property="expressPhone"/>
<result column="express_detail_address" property="expressDetailAddress"/>
<result column="spu_id" property="spuId"/>
<result column="name" property="name"/>
<result column="cate1_name" property="cate1Name"/>
<result column="cate2_name" property="cate2Name"/>
<result column="sku_name" property="skuName"/>
<result column="num" property="num"/>
<result column="sku_price" property="skuPrice"/>
<result column="sku_price_actual" property="skuPriceActual"/>
<result column="order_sku_id" property="orderSkuId"/>
<result column="pay_type" property="payType"/>
<result column="pay_time" property="payTime"/>
<result column="created_at" property="createdAt"/>
<result column="logistics_company" property="logisticsCompany"/>
<result column="mail_no" property="mailNo"/>
</resultMap>
<!-- <resultMap id="OrderExportDaoResult" type="com.liquidnet.service.kylin.dao.OrderExportDao">--> <!-- <resultMap id="OrderExportDaoResult" type="com.liquidnet.service.kylin.dao.OrderExportDao">-->
<!-- <result column="performance_title" property="performanceTitle"/>--> <!-- <result column="performance_title" property="performanceTitle"/>-->
<!-- <result column="user_mobile" property="userMobile"/>--> <!-- <result column="user_mobile" property="userMobile"/>-->
...@@ -1080,56 +1056,5 @@ GROUP BY user_mobile; ...@@ -1080,56 +1056,5 @@ GROUP BY user_mobile;
and gso.status not in (0, 5) and gso.status not in (0, 5)
group by do.code) temtable group by temtable.code group by do.code) temtable group by temtable.code
</select> </select>
<select id="exportMallOrder" resultMap="testDaoResult">
select gso.order_code as order_code,
gso.user_mobile as user_mobile,
gso.price_express as price_express,
gso.price_coupon as price_coupon,
gso.store_price_coupon as store_price_coupon,
goa.express_contacts as express_contacts,
goa.express_phone as express_phone,
CONCAT(goa.express_address,' ',goa.express_address_detail) as express_detail_address,
gso.pay_type as pay_type,
gso.pay_time as pay_time,
gso.created_at as created_at,
gm.logistics_company as logistics_company,
gm.mail_no as mail_no,
gos.spu_id as spu_id,
gg.name as name,
gg.cate1_name as cate1_name,
gg.cate2_name as cate2_name,
gos.sku_name as sku_name,
gos.num as num,
gos.sku_price as sku_price,
gos.sku_price_actual as sku_price_actual,
gos.order_sku_id as order_sku_id
from goblin_store_order as gso
inner join goblin_order_sku as gos on gos.order_id = gso.order_id
inner join (select spu_id, gg.name, gsgc1.name as cate1_name, gsgc2.name as cate2_name
from goblin_goods as gg
left join goblin_self_goods_category as gsgc1 on gsgc1.cate_id = gg.cate_fid
left join goblin_self_goods_category as gsgc2 on gsgc2.cate_id = gg.cate_sid) as gg
on gos.spu_id = gg.spu_id
inner join goblin_order_attr as goa on goa.order_id = gso.order_id
left join goblin_mail as gm on gm.order_id = gso.order_id
<where>
<if test="beginTime != null and endTime != null">
and gso.created_at between #{beginTime} and #{endTime}
</if>
<if test="states != null">
and gso.status in
<foreach collection="states" item="item" index="item" open="(" separator="," close=")">
${item}
</foreach>
</if>
<if test="mailType != null and mailType == '1'">
and gm.mail_no is null;
</if>
<if test="mailType != null and mailType == '2'">
and gm.mail_no is not null;
</if>
</where>
</select>
</mapper> </mapper>
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