Browse Source

企业新增字段

赵冬冬 4 years ago
parent
commit
6cc0e4f5a7
13 changed files with 311 additions and 151 deletions
  1. 34 0
      carbon-back/carbon-back-common/src/main/java/com/hcloud/microserver/system/facade/carbon/entity/GoodsOrderInfoDetailBo.java
  2. 37 0
      carbon-back/carbon-back-common/src/main/java/com/hcloud/microserver/system/facade/carbon/entity/GoodsOrderInfoVo.java
  3. 1 2
      carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/controller/OrderDetailController.java
  4. 8 4
      carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/controller/OrderInfoController.java
  5. 5 1
      carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/dao/GoodsOrderDetailMapper.java
  6. 3 0
      carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/dao/GoodsOrderInfoMapper.java
  7. 2 2
      carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/service/OrderDetailInfoService.java
  8. 2 0
      carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/service/OrderInfoService.java
  9. 10 2
      carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/service/impl/OrderDetailInfoServiceImpl.java
  10. 4 0
      carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/service/impl/OrderInfoServiceImpl.java
  11. 183 140
      carbon-back/carbon-back-service/src/main/resources/carbon/GoodsOrderDetailMapper.xml
  12. 19 0
      carbon-back/carbon-back-service/src/main/resources/carbon/GoodsOrderInfoMapper.xml
  13. 3 0
      sql/表结构变化语句/更新sql.sql

+ 34 - 0
carbon-back/carbon-back-common/src/main/java/com/hcloud/microserver/system/facade/carbon/entity/GoodsOrderInfoDetailBo.java

@@ -0,0 +1,34 @@
+package com.hcloud.microserver.system.facade.carbon.entity;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+@ApiModel
+public class GoodsOrderInfoDetailBo {
+    @ApiModelProperty("主键")
+    private String guid;
+
+    @ApiModelProperty("商品名称")
+    private String goodsName;
+
+    @ApiModelProperty("商品价格")
+    private String goodsPrice;
+
+    @ApiModelProperty("商品销售数量")
+    private String saleNum;
+
+    @ApiModelProperty("商品金额")
+    private String amount;
+
+    @ApiModelProperty("商品编码")
+    private String goodsCode;
+
+    @ApiModelProperty("商品到期时间")
+    private String goodsSaleDate;
+
+    @ApiModelProperty("商品类型")
+    private String typeName;
+}

+ 37 - 0
carbon-back/carbon-back-common/src/main/java/com/hcloud/microserver/system/facade/carbon/entity/GoodsOrderInfoVo.java

@@ -0,0 +1,37 @@
+package com.hcloud.microserver.system.facade.carbon.entity;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Data
+@ApiModel
+public class GoodsOrderInfoVo {
+    @ApiModelProperty("主键")
+    private String guid;
+    @ApiModelProperty("订单编码")
+    private String orderNo;
+    @ApiModelProperty("支付编码")
+    private String payNo;
+    @ApiModelProperty("创建时间")
+    private String createTime;
+    @ApiModelProperty("用户名称")
+    private String customerName;
+    @ApiModelProperty("用户类型")
+    private String customerType;
+    @ApiModelProperty("订单是否失效 记录状态 0无效 1有效")
+    private String state;
+    @ApiModelProperty("账号")
+    private String account;
+    @ApiModelProperty("企业账号")
+    private String phone;
+    @ApiModelProperty("用户类型")
+    private String typeName;
+    @ApiModelProperty("支付状态")
+    private String payChannel;
+
+    List<GoodsOrderInfoDetailBo> goodsOrderDetailList = new ArrayList<>();
+}

+ 1 - 2
carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/controller/OrderDetailController.java

@@ -22,7 +22,6 @@ public class OrderDetailController extends BaseController {
     @ApiOperation("分页查询订单详细信息")
     @GetMapping("/searchByOrderGuid")
     public ResponseBase searchByOrderGuid(@RequestParam(name = "orderGuid") String orderGuid) {
-        List<GoodsOrderDetail> goodsOrderDetails = this.orderDetailInfoService.findByGoodsOrderInfoGuid(orderGuid);
-        return responseResultSuccess(goodsOrderDetails);
+        return responseResultSuccess(this.orderDetailInfoService.findByGoodsOrderInfoGuid(orderGuid));
     }
 }

+ 8 - 4
carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/controller/OrderInfoController.java

@@ -3,10 +3,7 @@ package com.hcloud.microserver.system.bank.controller;
 import com.github.pagehelper.PageInfo;
 import com.hcloud.microserver.commoncore.base.ResultVO;
 import com.hcloud.microserver.commoncore.enums.ResultEnum;
-import com.hcloud.microserver.system.bank.bo.CreateOrderBO;
-import com.hcloud.microserver.system.bank.bo.OfflineOrderBO;
-import com.hcloud.microserver.system.bank.bo.OfflineOrderDetailBO;
-import com.hcloud.microserver.system.bank.bo.OrderInfoBO;
+import com.hcloud.microserver.system.bank.bo.*;
 import com.hcloud.microserver.system.bank.service.OrderInfoService;
 import com.hcloud.microserver.commoncore.base.BaseController;
 import com.hcloud.microserver.commoncore.base.ResponseBase;
@@ -33,6 +30,13 @@ public class OrderInfoController extends BaseController {
         PageInfo pageInfo = orderInfoService.searchOrderInfoByPage(goodsOrderInfoForm);
         return responseSuccess(pageInfo);
     }
+    @ApiOperation("证书查看")
+    @GetMapping("/credential")
+    public ResponseBase<CredentialInfoBO> searchCredentialInfoBO(@RequestParam(name = "guid") String guid) {
+        CredentialInfoBO credentialInfoBO = orderInfoService.searchCredentialInfo(guid);
+        return responseResultSuccess(credentialInfoBO);
+    }
+
 
     /**
      * 创建订单:

+ 5 - 1
carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/dao/GoodsOrderDetailMapper.java

@@ -4,6 +4,8 @@ import com.hcloud.microserver.system.bank.bo.OfflineOrderItemBO;
 import com.hcloud.microserver.system.bank.bo.OrderDetailInfoBO;
 import com.hcloud.microserver.commoncore.base.BaseMapper;
 import com.hcloud.microserver.system.facade.carbon.entity.GoodsOrderDetail;
+import com.hcloud.microserver.system.facade.carbon.entity.GoodsOrderInfoDetailBo;
+import com.hcloud.microserver.system.facade.carbon.entity.GoodsOrderInfoVo;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -26,7 +28,7 @@ public interface GoodsOrderDetailMapper extends BaseMapper<GoodsOrderDetail,Stri
      */
     int batchSaveOrderDetailList(List<GoodsOrderDetail> list);
 
-    List<GoodsOrderDetail> selectByGoodsOrderInfoGuid(@Param("goodsOrderInfoGuid") String goodsOrderInfoGuid);
+    GoodsOrderInfoVo selectByGoodsOrderInfoGuid(@Param("goodsOrderInfoGuid") String goodsOrderInfoGuid);
 
     /**
      * 根据订单guid查询订单项
@@ -34,4 +36,6 @@ public interface GoodsOrderDetailMapper extends BaseMapper<GoodsOrderDetail,Stri
      * @return
      */
     List<OfflineOrderItemBO> queryOrderDetail(@Param("orderGuid") String orderGuid);
+
+    List<GoodsOrderInfoDetailBo> findByGoodsOrderDetailByOrderId(@Param("orderGuid") String orderGuid);
 }

+ 3 - 0
carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/dao/GoodsOrderInfoMapper.java

@@ -1,5 +1,6 @@
 package com.hcloud.microserver.system.bank.dao;
 
+import com.hcloud.microserver.system.bank.bo.CredentialInfoBO;
 import com.hcloud.microserver.system.bank.bo.OfflineOrderBO;
 import com.hcloud.microserver.system.bank.bo.OfflineOrderDetailBO;
 import com.hcloud.microserver.system.bank.bo.OrderInfoBO;
@@ -59,4 +60,6 @@ public interface GoodsOrderInfoMapper extends BaseMapper<GoodsOrderInfo,String>
      * @return
      */
     OfflineOrderDetailBO queryOfflineOrderDetial(@Param("guid") String guid);
+
+    CredentialInfoBO searchCredentialInfo(@Param("guid") String guid);
 }

+ 2 - 2
carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/service/OrderDetailInfoService.java

@@ -1,7 +1,7 @@
 package com.hcloud.microserver.system.bank.service;
 
 import com.hcloud.microserver.commoncore.base.BaseServie;
-import com.hcloud.microserver.system.facade.carbon.entity.GoodsOrderDetail;
+import com.hcloud.microserver.system.facade.carbon.entity.GoodsOrderInfoVo;
 import com.hcloud.microserver.system.facade.carbon.forms.GoodsOrderDetailForm;
 
 import java.util.List;
@@ -24,5 +24,5 @@ public interface OrderDetailInfoService extends BaseServie<GoodsOrderDetailForm,
      */
     int batchSaveOrderDetailByList(List<GoodsOrderDetailForm> batchList);
 
-    List<GoodsOrderDetail> findByGoodsOrderInfoGuid(String goodsOrderInfoGuid);
+    GoodsOrderInfoVo findByGoodsOrderInfoGuid(String goodsOrderInfoGuid);
 }

+ 2 - 0
carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/service/OrderInfoService.java

@@ -3,6 +3,7 @@ package com.hcloud.microserver.system.bank.service;
 import com.github.pagehelper.PageInfo;
 import com.hcloud.microserver.commoncore.base.BaseServie;
 import com.hcloud.microserver.system.bank.bo.CreateOrderBO;
+import com.hcloud.microserver.system.bank.bo.CredentialInfoBO;
 import com.hcloud.microserver.system.bank.bo.OfflineOrderBO;
 import com.hcloud.microserver.system.bank.bo.OfflineOrderDetailBO;
 import com.hcloud.microserver.system.facade.carbon.forms.GoodsOrderInfoForm;
@@ -110,4 +111,5 @@ public interface OrderInfoService extends BaseServie<GoodsOrderInfoForm,String>
      */
     int collectMoneyDeal(OfflineOrderPayVoucherForm payVoucher);
 
+    CredentialInfoBO searchCredentialInfo(String orderId);
 }

+ 10 - 2
carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/service/impl/OrderDetailInfoServiceImpl.java

@@ -6,8 +6,11 @@ import com.hcloud.microserver.system.bank.service.OrderDetailInfoService;
 import com.hcloud.microserver.commoncore.util.BeanCopyUtil;
 import com.hcloud.microserver.commoncore.util.GetUUID;
 import com.hcloud.microserver.system.facade.carbon.entity.GoodsOrderDetail;
+import com.hcloud.microserver.system.facade.carbon.entity.GoodsOrderInfoDetailBo;
+import com.hcloud.microserver.system.facade.carbon.entity.GoodsOrderInfoVo;
 import com.hcloud.microserver.system.facade.carbon.forms.GoodsOrderDetailForm;
 import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
 
 import javax.annotation.Resource;
 import java.util.List;
@@ -52,8 +55,13 @@ public class OrderDetailInfoServiceImpl implements OrderDetailInfoService {
     }
 
     @Override
-    public List<GoodsOrderDetail> findByGoodsOrderInfoGuid(String goodsOrderInfoGuid) {
-        return this.goodsOrderDetailMapper.selectByGoodsOrderInfoGuid(goodsOrderInfoGuid);
+    public GoodsOrderInfoVo findByGoodsOrderInfoGuid(String goodsOrderInfoGuid) {
+        GoodsOrderInfoVo goodsOrderInfoVo = this.goodsOrderDetailMapper.selectByGoodsOrderInfoGuid(goodsOrderInfoGuid);
+        if(!StringUtils.isEmpty(goodsOrderInfoVo)){
+            List<GoodsOrderInfoDetailBo> list =  goodsOrderDetailMapper.findByGoodsOrderDetailByOrderId(goodsOrderInfoGuid);
+            goodsOrderInfoVo.setGoodsOrderDetailList(list);
+        }
+        return goodsOrderInfoVo;
     }
 
     @Override

+ 4 - 0
carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/service/impl/OrderInfoServiceImpl.java

@@ -538,6 +538,10 @@ public class OrderInfoServiceImpl implements OrderInfoService {
         return result;
     }
 
+    public CredentialInfoBO searchCredentialInfo(String orderId){
+        return goodsOrderInfoMapper.searchCredentialInfo(orderId);
+    }
+
     @Override
     public int delByPrimaryKey(String guid) {
         return goodsOrderInfoMapper.deleteByPrimaryKey(guid);

+ 183 - 140
carbon-back/carbon-back-service/src/main/resources/carbon/GoodsOrderDetailMapper.xml

@@ -1,30 +1,30 @@
 <?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.hcloud.microserver.system.bank.dao.GoodsOrderDetailMapper">
-  <resultMap id="BaseResultMap" type="com.hcloud.microserver.system.facade.carbon.entity.GoodsOrderDetail">
-    <id column="guid" jdbcType="CHAR" property="guid" />
-    <result column="fk_order_guid" jdbcType="CHAR" property="fkOrderGuid" />
-    <result column="fk_goods_guid" jdbcType="CHAR" property="fkGoodsGuid" />
-    <result column="goods_name" jdbcType="VARCHAR" property="goodsName" />
-    <result column="goods_price" jdbcType="DECIMAL" property="goodsPrice" />
-    <result column="sale_num" jdbcType="DECIMAL" property="saleNum" />
-    <result column="amount" jdbcType="DECIMAL" property="amount" />
-    <result column="state" jdbcType="INTEGER" property="state" />
-    <result column="create_user" jdbcType="CHAR" property="createUser" />
-    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
-    <association property="goodsInfo" column="fk_goods_guid"
-                 select="GoodsInfoMapper.selectByPrimaryKey"/>
-  </resultMap>
-  <sql id="Base_Column_List">
+    <resultMap id="BaseResultMap" type="com.hcloud.microserver.system.facade.carbon.entity.GoodsOrderDetail">
+        <id column="guid" jdbcType="CHAR" property="guid"/>
+        <result column="fk_order_guid" jdbcType="CHAR" property="fkOrderGuid"/>
+        <result column="fk_goods_guid" jdbcType="CHAR" property="fkGoodsGuid"/>
+        <result column="goods_name" jdbcType="VARCHAR" property="goodsName"/>
+        <result column="goods_price" jdbcType="DECIMAL" property="goodsPrice"/>
+        <result column="sale_num" jdbcType="DECIMAL" property="saleNum"/>
+        <result column="amount" jdbcType="DECIMAL" property="amount"/>
+        <result column="state" jdbcType="INTEGER" property="state"/>
+        <result column="create_user" jdbcType="CHAR" property="createUser"/>
+        <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
+        <association property="goodsInfo" column="fk_goods_guid"
+                     select="com.hcloud.microserver.system.bank.dao.GoodsInfoMapper.selectByPrimaryKey"/>
+    </resultMap>
+    <sql id="Base_Column_List">
     guid, fk_order_guid, fk_goods_guid, goods_name, goods_price, sale_num, amount, state, 
     create_user, create_time
   </sql>
-  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
-    select 
-    <include refid="Base_Column_List" />
-    from t_goods_order_detail
-    where guid = #{guid,jdbcType=CHAR}
-  </select>
+    <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
+        select
+        <include refid="Base_Column_List"/>
+        from t_goods_order_detail
+        where guid = #{guid,jdbcType=CHAR}
+    </select>
     <select id="getOrderDetailListByOrderId" parameterType="java.lang.String"
             resultType="com.hcloud.microserver.system.bank.bo.OrderDetailInfoBO">
       SELECT
@@ -52,7 +52,7 @@
     delete from t_goods_order_detail
     where guid = #{guid,jdbcType=CHAR}
   </delete>
-  <insert id="insert" parameterType="com.hcloud.microserver.system.facade.carbon.entity.GoodsOrderDetail">
+    <insert id="insert" parameterType="com.hcloud.microserver.system.facade.carbon.entity.GoodsOrderDetail">
     insert into t_goods_order_detail (guid, fk_order_guid, fk_goods_guid, 
       goods_name, goods_price, sale_num, 
       amount, state, create_user, 
@@ -62,118 +62,119 @@
       #{amount,jdbcType=DECIMAL}, #{state,jdbcType=INTEGER}, #{createUser,jdbcType=CHAR}, 
       #{createTime,jdbcType=TIMESTAMP})
   </insert>
-  <insert id="batchSaveOrderDetailList">
+    <insert id="batchSaveOrderDetailList">
         insert into t_goods_order_detail (guid, fk_order_guid, fk_goods_guid,
-      goods_name, goods_price, sale_num,
-      amount, state,create_time) values
-      <foreach collection="list" item="bean" separator="," open="" close="">
-       ( REPLACE(UUID(),'-',''), #{bean.fkOrderGuid,jdbcType=CHAR}, #{bean.fkGoodsGuid,jdbcType=CHAR},
-        #{bean.goodsName,jdbcType=VARCHAR}, #{bean.goodsPrice,jdbcType=DECIMAL}, #{bean.saleNum,jdbcType=DECIMAL},
-        #{bean.amount,jdbcType=DECIMAL}, #{bean.state,jdbcType=INTEGER},#{bean.createTime,jdbcType=TIMESTAMP})
-      </foreach>
-  </insert>
-  <insert id="insertSelective" parameterType="com.hcloud.microserver.system.facade.carbon.entity.GoodsOrderDetail">
-    insert into t_goods_order_detail
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="guid != null">
-        guid,
-      </if>
-      <if test="fkOrderGuid != null">
-        fk_order_guid,
-      </if>
-      <if test="fkGoodsGuid != null">
-        fk_goods_guid,
-      </if>
-      <if test="goodsName != null">
-        goods_name,
-      </if>
-      <if test="goodsPrice != null">
-        goods_price,
-      </if>
-      <if test="saleNum != null">
-        sale_num,
-      </if>
-      <if test="amount != null">
-        amount,
-      </if>
-      <if test="state != null">
-        state,
-      </if>
-      <if test="createUser != null">
-        create_user,
-      </if>
-      <if test="createTime != null">
-        create_time,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="guid != null">
-        #{guid,jdbcType=CHAR},
-      </if>
-      <if test="fkOrderGuid != null">
-        #{fkOrderGuid,jdbcType=CHAR},
-      </if>
-      <if test="fkGoodsGuid != null">
-        #{fkGoodsGuid,jdbcType=CHAR},
-      </if>
-      <if test="goodsName != null">
-        #{goodsName,jdbcType=VARCHAR},
-      </if>
-      <if test="goodsPrice != null">
-        #{goodsPrice,jdbcType=DECIMAL},
-      </if>
-      <if test="saleNum != null">
-        #{saleNum,jdbcType=DECIMAL},
-      </if>
-      <if test="amount != null">
-        #{amount,jdbcType=DECIMAL},
-      </if>
-      <if test="state != null">
-        #{state,jdbcType=INTEGER},
-      </if>
-      <if test="createUser != null">
-        #{createUser,jdbcType=CHAR},
-      </if>
-      <if test="createTime != null">
-        #{createTime,jdbcType=TIMESTAMP},
-      </if>
-    </trim>
-  </insert>
+        goods_name, goods_price, sale_num,
+        amount, state,create_time) values
+        <foreach collection="list" item="bean" separator="," open="" close="">
+            ( REPLACE(UUID(),'-',''), #{bean.fkOrderGuid,jdbcType=CHAR}, #{bean.fkGoodsGuid,jdbcType=CHAR},
+            #{bean.goodsName,jdbcType=VARCHAR}, #{bean.goodsPrice,jdbcType=DECIMAL}, #{bean.saleNum,jdbcType=DECIMAL},
+            #{bean.amount,jdbcType=DECIMAL}, #{bean.state,jdbcType=INTEGER},#{bean.createTime,jdbcType=TIMESTAMP})
+        </foreach>
+    </insert>
+    <insert id="insertSelective" parameterType="com.hcloud.microserver.system.facade.carbon.entity.GoodsOrderDetail">
+        insert into t_goods_order_detail
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="guid != null">
+                guid,
+            </if>
+            <if test="fkOrderGuid != null">
+                fk_order_guid,
+            </if>
+            <if test="fkGoodsGuid != null">
+                fk_goods_guid,
+            </if>
+            <if test="goodsName != null">
+                goods_name,
+            </if>
+            <if test="goodsPrice != null">
+                goods_price,
+            </if>
+            <if test="saleNum != null">
+                sale_num,
+            </if>
+            <if test="amount != null">
+                amount,
+            </if>
+            <if test="state != null">
+                state,
+            </if>
+            <if test="createUser != null">
+                create_user,
+            </if>
+            <if test="createTime != null">
+                create_time,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="guid != null">
+                #{guid,jdbcType=CHAR},
+            </if>
+            <if test="fkOrderGuid != null">
+                #{fkOrderGuid,jdbcType=CHAR},
+            </if>
+            <if test="fkGoodsGuid != null">
+                #{fkGoodsGuid,jdbcType=CHAR},
+            </if>
+            <if test="goodsName != null">
+                #{goodsName,jdbcType=VARCHAR},
+            </if>
+            <if test="goodsPrice != null">
+                #{goodsPrice,jdbcType=DECIMAL},
+            </if>
+            <if test="saleNum != null">
+                #{saleNum,jdbcType=DECIMAL},
+            </if>
+            <if test="amount != null">
+                #{amount,jdbcType=DECIMAL},
+            </if>
+            <if test="state != null">
+                #{state,jdbcType=INTEGER},
+            </if>
+            <if test="createUser != null">
+                #{createUser,jdbcType=CHAR},
+            </if>
+            <if test="createTime != null">
+                #{createTime,jdbcType=TIMESTAMP},
+            </if>
+        </trim>
+    </insert>
 
-  <update id="updateByPrimaryKeySelective" parameterType="com.hcloud.microserver.system.facade.carbon.entity.GoodsOrderDetail">
-    update t_goods_order_detail
-    <set>
-      <if test="fkOrderGuid != null">
-        fk_order_guid = #{fkOrderGuid,jdbcType=CHAR},
-      </if>
-      <if test="fkGoodsGuid != null">
-        fk_goods_guid = #{fkGoodsGuid,jdbcType=CHAR},
-      </if>
-      <if test="goodsName != null">
-        goods_name = #{goodsName,jdbcType=VARCHAR},
-      </if>
-      <if test="goodsPrice != null">
-        goods_price = #{goodsPrice,jdbcType=DECIMAL},
-      </if>
-      <if test="saleNum != null">
-        sale_num = #{saleNum,jdbcType=DECIMAL},
-      </if>
-      <if test="amount != null">
-        amount = #{amount,jdbcType=DECIMAL},
-      </if>
-      <if test="state != null">
-        state = #{state,jdbcType=INTEGER},
-      </if>
-      <if test="createUser != null">
-        create_user = #{createUser,jdbcType=CHAR},
-      </if>
-      <if test="createTime != null">
-        create_time = #{createTime,jdbcType=TIMESTAMP},
-      </if>
-    </set>
-    where guid = #{guid,jdbcType=CHAR}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="com.hcloud.microserver.system.facade.carbon.entity.GoodsOrderDetail">
+    <update id="updateByPrimaryKeySelective"
+            parameterType="com.hcloud.microserver.system.facade.carbon.entity.GoodsOrderDetail">
+        update t_goods_order_detail
+        <set>
+            <if test="fkOrderGuid != null">
+                fk_order_guid = #{fkOrderGuid,jdbcType=CHAR},
+            </if>
+            <if test="fkGoodsGuid != null">
+                fk_goods_guid = #{fkGoodsGuid,jdbcType=CHAR},
+            </if>
+            <if test="goodsName != null">
+                goods_name = #{goodsName,jdbcType=VARCHAR},
+            </if>
+            <if test="goodsPrice != null">
+                goods_price = #{goodsPrice,jdbcType=DECIMAL},
+            </if>
+            <if test="saleNum != null">
+                sale_num = #{saleNum,jdbcType=DECIMAL},
+            </if>
+            <if test="amount != null">
+                amount = #{amount,jdbcType=DECIMAL},
+            </if>
+            <if test="state != null">
+                state = #{state,jdbcType=INTEGER},
+            </if>
+            <if test="createUser != null">
+                create_user = #{createUser,jdbcType=CHAR},
+            </if>
+            <if test="createTime != null">
+                create_time = #{createTime,jdbcType=TIMESTAMP},
+            </if>
+        </set>
+        where guid = #{guid,jdbcType=CHAR}
+    </update>
+    <update id="updateByPrimaryKey" parameterType="com.hcloud.microserver.system.facade.carbon.entity.GoodsOrderDetail">
     update t_goods_order_detail
     set fk_order_guid = #{fkOrderGuid,jdbcType=CHAR},
       fk_goods_guid = #{fkGoodsGuid,jdbcType=CHAR},
@@ -187,15 +188,32 @@
     where guid = #{guid,jdbcType=CHAR}
   </update>
 
-  <select id="selectByGoodsOrderInfoGuid" parameterType="string" resultMap="BaseResultMap">
-    select
-      <include refid="Base_Column_List"/>
-    from t_goods_order_detail
-    where state = 1
-    and fk_order_guid = #{goodsOrderInfoGuid,jdbcType=VARCHAR}
+    <select id="selectByGoodsOrderInfoGuid" parameterType="string" resultType="com.hcloud.microserver.system.facade.carbon.entity.GoodsOrderInfoVo">
+      SELECT
+            b.guid AS guid,
+            b.order_no AS orderNo,
+            b.pay_no AS payNo,
+            b.create_time AS createTime,
+            b.customer_name AS customerName,
+            b.customer_type AS customerType,
+            b.state AS state,
+            c.account AS account,
+            c.phone AS phone,
+            d.type_name AS typeName,
+            e.pay_channel AS payChannel
+        FROM
+            t_goods_order_info b
+        LEFT JOIN t_customer_info c ON b.fk_customer_guid = c.guid
+        LEFT JOIN t_customer_company_type d ON b.customer_type = d.guid
+        LEFT JOIN t_goods_pay_order e ON e.fk_order_id = b.guid
+        WHERE
+            b.state = 1
+        AND e.pay_status = 2
+        AND b.guid =  #{goodsOrderInfoGuid} LIMIT 1
   </select>
-  <!-- 根据订单guid查询订单项 -->
-  <select id="queryOrderDetail" parameterType="String" resultType="com.hcloud.microserver.system.bank.bo.OfflineOrderItemBO">
+    <!-- 根据订单guid查询订单项 -->
+    <select id="queryOrderDetail" parameterType="String"
+            resultType="com.hcloud.microserver.system.bank.bo.OfflineOrderItemBO">
     SELECT g.goods_code AS goodsCode,
 			 g.goods_type AS goodsType,
 			 d.goods_name AS goodsName,
@@ -206,4 +224,29 @@
     FROM t_goods_order_detail d LEFT JOIN t_goods_info g ON d.fk_goods_guid=g.guid
     WHERE d.fk_order_guid=#{orderGuid}
   </select>
+    <select id="findByGoodsOrderDetailByOrderId"
+            resultType="com.hcloud.microserver.system.facade.carbon.entity.GoodsOrderInfoDetailBo">
+    SELECT
+	a.guid AS guid,
+	-- 	a.fk_order_guid AS fkOrderGuid,
+	-- 	a.fk_goods_guid AS fkGoodsGuid,
+	a.goods_name AS goodsName,
+	a.goods_price AS goodsPrice,
+	a.sale_num AS saleNum,
+	a.amount AS amount,
+	-- 	a.state AS state,
+	--  	a.create_user AS createUser,
+	-- 	a.create_time AS createTime,
+	b.goods_code AS goodsCode,
+	b.goods_sale_date AS goodsSaleDate,
+	e.type_name AS typeName
+FROM
+	t_goods_order_detail a
+LEFT JOIN t_goods_info b ON a.fk_goods_guid = b.guid
+LEFT JOIN t_goods_detail c ON c.fk_goods_guid = a.fk_goods_guid
+LEFT JOIN t_product_info d ON c.fk_product_guid = d.guid
+LEFT JOIN t_product_type e ON d.fk_product_type = e.guid
+WHERE
+	a.fk_order_guid =  #{orderGuid}
+  </select>
 </mapper>

+ 19 - 0
carbon-back/carbon-back-service/src/main/resources/carbon/GoodsOrderInfoMapper.xml

@@ -413,4 +413,23 @@
 									  LEFT JOIN t_goods_pay_order p ON p.fk_order_id = o.guid
 					WHERE o.guid= #{guid}
     </select>
+    <select id="searchCredentialInfo" resultType="com.hcloud.microserver.system.bank.bo.CredentialInfoBO">
+        SELECT
+            DATE_FORMAT(aa.buy_date,'%Y年%m月%d日') AS buyDate,
+            aa.carbon_amount AS carbonAmount,
+            aa.credential_no AS credentialNo,
+            bb.customer_name AS customerName,
+            bb.nick_name AS nickName,
+            cc.company_name AS companyName,
+            dd.order_amount AS OrderAmount,
+            aa.farmer_names AS farmerName,
+            YEAR(aa.buy_date) AS year
+        FROM
+            t_goods_credential_info aa
+        LEFT JOIN t_goods_order_info dd ON aa.fk_order_id = dd.guid
+        LEFT JOIN t_customer_info bb ON aa.fk_customer_id = bb.guid
+        LEFT JOIN t_customer_company_info cc ON cc.fk_customer_id = bb.guid
+        WHERE
+        aa.fk_order_id = #{guid}
+    </select>
 </mapper>

+ 3 - 0
sql/表结构变化语句/更新sql.sql

@@ -103,3 +103,6 @@ CREATE TABLE `t_order_setting` (
 -- Records of t_order_setting
 -- ----------------------------
 INSERT INTO `t_order_setting` VALUES ('1', '1');
+
+# 企业表新增企业类型字段
+ALTER TABLE `t_customer_company_info` ADD COLUMN `company_type` VARCHAR (32) DEFAULT NULL COMMENT '企业类型' AFTER `fk_customer_id`;