LAPTOP-FO2T5SIU\35838 8 maanden geleden
bovenliggende
commit
4ddc36c833

+ 33 - 0
pro-base/src/main/java/com/idea/invoice/controller/InvoiceManageController.java

@@ -3,6 +3,7 @@ package com.idea.invoice.controller;
 import com.github.pagehelper.PageInfo;
 import com.idea.invoice.dto.InvoiceManageDto;
 import com.idea.invoice.model.InvoiceBank;
+import com.idea.invoice.model.InvoiceManage;
 import com.idea.invoice.service.InvoiceManageService;
 import com.rockstar.common.base.BaseController;
 import com.rockstar.common.domain.AjaxResult;
@@ -18,6 +19,8 @@ import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.ResponseBody;
 
+import java.util.List;
+
 @Controller
 @RequestMapping(value = "InvoiceManageController")
 @Api(value="开票管理")
@@ -95,4 +98,34 @@ public class InvoiceManageController extends BaseController {
         return modelService.getBankTaxRateByFloor(id);
     }
 
+    @PostMapping(value = "batchListVo",produces = {"application/json;charset=UTF-8"})
+    @ResponseBody
+    public List<InvoiceManageDto> batchListVo(String invoiceManages){
+        return modelService.batchListVo(invoiceManages);
+    }
+
+
+    /**
+     * 推送开票
+     * @param record
+     * @return
+     */
+    @PostMapping(value = "sendInvoice",produces = {"application/json;charset=UTF-8"})
+    @ResponseBody
+    public AjaxResult sendInvoice(InvoiceManageDto record){
+        int result = modelService.sendInvoice(record);
+        return result(result);
+    }
+
+    /**
+     * 批量推送开票
+     * @param list
+     * @return
+     */
+    @PostMapping(value = "batchSendInvoice",produces = {"application/json;charset=UTF-8"})
+    @ResponseBody
+    public AjaxResult batchSendInvoice(List<InvoiceManageDto> list){
+        return  modelService.batchSendInvoice(list);
+    }
+
 }

+ 12 - 0
pro-base/src/main/java/com/idea/invoice/controller/ReceiptManageController.java

@@ -0,0 +1,12 @@
+package com.idea.invoice.controller;
+
+import com.rockstar.common.base.BaseController;
+import io.swagger.annotations.Api;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+@Controller
+@RequestMapping(value = "ReceiptManageController")
+@Api(value="票据管理")
+public class ReceiptManageController extends BaseController {
+}

+ 31 - 0
pro-base/src/main/java/com/idea/invoice/mapper/ReceiptManageMapper.java

@@ -0,0 +1,31 @@
+package com.idea.invoice.mapper;
+
+import java.util.List;
+
+import com.idea.invoice.model.ReceiptManage;
+import com.idea.invoice.model.ReceiptManageExample;
+import org.apache.ibatis.annotations.Param;
+
+public interface ReceiptManageMapper {
+    long countByExample(ReceiptManageExample example);
+
+    int deleteByExample(ReceiptManageExample example);
+
+    int deleteByPrimaryKey(String id);
+
+    int insert(ReceiptManage record);
+
+    int insertSelective(ReceiptManage record);
+
+    List<ReceiptManage> selectByExample(ReceiptManageExample example);
+
+    ReceiptManage selectByPrimaryKey(String id);
+
+    int updateByExampleSelective(@Param("record") ReceiptManage record, @Param("example") ReceiptManageExample example);
+
+    int updateByExample(@Param("record") ReceiptManage record, @Param("example") ReceiptManageExample example);
+
+    int updateByPrimaryKeySelective(ReceiptManage record);
+
+    int updateByPrimaryKey(ReceiptManage record);
+}

+ 169 - 0
pro-base/src/main/java/com/idea/invoice/model/ReceiptManage.java

@@ -0,0 +1,169 @@
+package com.idea.invoice.model;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+public class ReceiptManage implements Serializable {
+    private String id;
+
+    private String customerManagementId;
+
+    private String businessId;
+
+    private String batchNumber;
+
+    private String roomSelectionNumber;
+
+    private String houseName;
+
+    private String buyerName;
+
+    private String receiptType;
+
+    private BigDecimal receiptMoney;
+
+    private String receiptNumber;
+
+    private Integer receiptStatus;
+
+    private String associationNumber;
+
+    private String createdId;
+
+    private Date createdAt;
+
+    private Date updatedAt;
+
+    private String updatedId;
+
+    private static final long serialVersionUID = 1L;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id == null ? null : id.trim();
+    }
+
+    public String getCustomerManagementId() {
+        return customerManagementId;
+    }
+
+    public void setCustomerManagementId(String customerManagementId) {
+        this.customerManagementId = customerManagementId == null ? null : customerManagementId.trim();
+    }
+
+    public String getBusinessId() {
+        return businessId;
+    }
+
+    public void setBusinessId(String businessId) {
+        this.businessId = businessId == null ? null : businessId.trim();
+    }
+
+    public String getBatchNumber() {
+        return batchNumber;
+    }
+
+    public void setBatchNumber(String batchNumber) {
+        this.batchNumber = batchNumber == null ? null : batchNumber.trim();
+    }
+
+    public String getRoomSelectionNumber() {
+        return roomSelectionNumber;
+    }
+
+    public void setRoomSelectionNumber(String roomSelectionNumber) {
+        this.roomSelectionNumber = roomSelectionNumber == null ? null : roomSelectionNumber.trim();
+    }
+
+    public String getHouseName() {
+        return houseName;
+    }
+
+    public void setHouseName(String houseName) {
+        this.houseName = houseName == null ? null : houseName.trim();
+    }
+
+    public String getBuyerName() {
+        return buyerName;
+    }
+
+    public void setBuyerName(String buyerName) {
+        this.buyerName = buyerName == null ? null : buyerName.trim();
+    }
+
+    public String getReceiptType() {
+        return receiptType;
+    }
+
+    public void setReceiptType(String receiptType) {
+        this.receiptType = receiptType == null ? null : receiptType.trim();
+    }
+
+    public BigDecimal getReceiptMoney() {
+        return receiptMoney;
+    }
+
+    public void setReceiptMoney(BigDecimal receiptMoney) {
+        this.receiptMoney = receiptMoney;
+    }
+
+    public String getReceiptNumber() {
+        return receiptNumber;
+    }
+
+    public void setReceiptNumber(String receiptNumber) {
+        this.receiptNumber = receiptNumber == null ? null : receiptNumber.trim();
+    }
+
+    public Integer getReceiptStatus() {
+        return receiptStatus;
+    }
+
+    public void setReceiptStatus(Integer receiptStatus) {
+        this.receiptStatus = receiptStatus;
+    }
+
+    public String getAssociationNumber() {
+        return associationNumber;
+    }
+
+    public void setAssociationNumber(String associationNumber) {
+        this.associationNumber = associationNumber == null ? null : associationNumber.trim();
+    }
+
+    public String getCreatedId() {
+        return createdId;
+    }
+
+    public void setCreatedId(String createdId) {
+        this.createdId = createdId == null ? null : createdId.trim();
+    }
+
+    public Date getCreatedAt() {
+        return createdAt;
+    }
+
+    public void setCreatedAt(Date createdAt) {
+        this.createdAt = createdAt;
+    }
+
+    public Date getUpdatedAt() {
+        return updatedAt;
+    }
+
+    public void setUpdatedAt(Date updatedAt) {
+        this.updatedAt = updatedAt;
+    }
+
+    public String getUpdatedId() {
+        return updatedId;
+    }
+
+    public void setUpdatedId(String updatedId) {
+        this.updatedId = updatedId == null ? null : updatedId.trim();
+    }
+}

File diff suppressed because it is too large
+ 1282 - 0
pro-base/src/main/java/com/idea/invoice/model/ReceiptManageExample.java


+ 78 - 12
pro-base/src/main/java/com/idea/invoice/service/InvoiceManageService.java

@@ -26,6 +26,7 @@ import com.idea.invoice.model.InvoiceManageExample;
 import com.idea.invoice.util.InvoiceConstant;
 import com.idea.paymentManagement.service.PayLogService;
 import com.rockstar.common.base.BaseService;
+import com.rockstar.common.domain.AjaxResult;
 import com.rockstar.frame.model.extend.DateTrans;
 import com.rockstar.frame.model.extend.Tablepar;
 import com.rockstar.shiro.util.ShiroUtils;
@@ -34,8 +35,10 @@ import com.rockstar.util.StringUtils;
 import org.apache.commons.collections.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import java.math.BigDecimal;
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Date;
 import java.util.List;
@@ -61,6 +64,9 @@ public class InvoiceManageService implements BaseService<InvoiceManage, InvoiceM
     private InvoiceBankService invoiceBankService;
     @Autowired
     private SysDictService sysDictService;
+    // 注入自身 防止食物不生效
+    @Autowired
+    private InvoiceManageService invoiceManageService;
 
     @Override
     public int deleteByPrimaryKey(String s) {
@@ -155,18 +161,6 @@ public class InvoiceManageService implements BaseService<InvoiceManage, InvoiceM
         return result;
     }
 
-    /**
-     * 推送开票
-     * @param model
-     */
-    public void sendInvoice(InvoiceManageDto model){
-        model.setSendStatus("1");
-        model.setSubmitTime(new Date());
-        model.setSubmitUser(ShiroUtils.getUserId());
-        updateByPrimaryKeySelective(model);
-        // TODO: 2024/10/17 等待接口 推送开票信息
-    }
-
 
     public InvoiceManageDto getById(String id) {
         InvoiceManage invoiceManage = selectByPrimaryKey(id);
@@ -288,4 +282,76 @@ public class InvoiceManageService implements BaseService<InvoiceManage, InvoiceM
         return jsonObject;
     }
 
+    /**
+     * 批量开票列表
+     * @param invoiceManages
+     * @return
+     */
+    public List<InvoiceManageDto> batchListVo(String invoiceManages){
+
+        List<InvoiceManageDto> result = new ArrayList<>();
+        String[] ids = invoiceManages.split(",");
+        for(String id :ids){
+            InvoiceManageDto model = getById(id);
+            JSONObject jsonObject = getBankTaxRateByFloor(id);
+            model.setInvoiceSellerBank(jsonObject.getString("invoiceSellerBank"));
+            model.setInvoiceTax(jsonObject.getString("invoiceTax"));
+            result.add(model);
+        }
+        return result;
+    }
+
+    /**
+     * 推送开票
+     * @param model
+     */
+    @Transactional
+    public int sendInvoice(InvoiceManageDto model){
+        model.setSendStatus("1");
+        model.setSubmitTime(new Date());
+        model.setSubmitUser(ShiroUtils.getUserId());
+        int result = updateByPrimaryKeySelective(model);
+        // TODO: 2024/10/17 等待接口 推送开票信息
+        return result;
+    }
+
+    /**
+     * 批量生效
+     * @param list
+     * @return
+     */
+    public AjaxResult batchSendInvoice(List<InvoiceManageDto> list){
+
+        // 推送前校验状态
+        for (InvoiceManageDto model : list) {
+            InvoiceManage invoiceManage = selectByPrimaryKey(model.getId());
+            if(null!=invoiceManage && !InvoiceConstant.INVOICE_STATUS_WAIT.equals(invoiceManage.getInvoiceStatus())
+                    && !InvoiceConstant.INVOICE_STATUS_ERROR.equals(invoiceManage.getInvoiceStatus())){
+                return AjaxResult.error(504, "提交失败,开票状态发生变化");
+            }
+        }
+        int result = 0;
+        String userId = ShiroUtils.getUserId();
+        for (InvoiceManageDto invoiceManage : list) {
+            invoiceManage.setUpdateUser(userId);
+            InvoiceManage newRecord = selectByPrimaryKey(invoiceManage.getId());
+            // 如果流水号为空 则创建一个流水号
+            String serialNo;
+            if(StringUtils.isEmpty(newRecord.getSerialNo())){
+                serialNo = "wuxi-" + System.currentTimeMillis() + "-001";
+                newRecord.setSerialNo(serialNo);
+                updateByPrimaryKeySelective(newRecord);
+            }else {
+                serialNo = newRecord.getSerialNo();
+            }
+            invoiceManage.setSerialNo(serialNo);
+            try {
+                result += invoiceManageService.sendInvoice(invoiceManage);
+            }catch (Exception e){
+                return AjaxResult.error(503, e.getMessage());
+            }
+        }
+        return result > 0 ? AjaxResult.success() : AjaxResult.error();
+    }
+
 }

+ 80 - 0
pro-base/src/main/java/com/idea/invoice/service/ReceiptManageService.java

@@ -0,0 +1,80 @@
+package com.idea.invoice.service;
+
+import cn.hutool.core.util.IdUtil;
+import com.idea.invoice.mapper.ReceiptManageMapper;
+import com.idea.invoice.model.ReceiptManage;
+import com.idea.invoice.model.ReceiptManageExample;
+import com.rockstar.common.base.BaseService;
+import com.rockstar.util.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class ReceiptManageService implements BaseService<ReceiptManage, ReceiptManageExample> {
+
+    @Autowired
+    private ReceiptManageMapper modelMapper;
+
+    @Override
+    public int deleteByPrimaryKey(String s) {
+        return modelMapper.deleteByPrimaryKey(s);
+    }
+
+    @Override
+    public int insertSelective(ReceiptManage receiptManage) {
+        receiptManage.setId(IdUtil.simpleUUID());
+        return modelMapper.insertSelective(receiptManage);
+    }
+
+    @Override
+    public ReceiptManage selectByPrimaryKey(String s) {
+        return modelMapper.selectByPrimaryKey(s);
+    }
+
+    @Override
+    public int updateByPrimaryKeySelective(ReceiptManage receiptManage) {
+        return modelMapper.updateByPrimaryKeySelective(receiptManage);
+    }
+
+    @Override
+    public int updateByExampleSelective(ReceiptManage receiptManage, ReceiptManageExample receiptManageExample) {
+        return modelMapper.updateByExampleSelective(receiptManage,receiptManageExample);
+    }
+
+    @Override
+    public int updateByExample(ReceiptManage receiptManage, ReceiptManageExample receiptManageExample) {
+        return modelMapper.updateByExample(receiptManage,receiptManageExample);
+    }
+
+    @Override
+    public List<ReceiptManage> selectByExample(ReceiptManageExample receiptManageExample) {
+        return modelMapper.selectByExample(receiptManageExample);
+    }
+
+    @Override
+    public long countByExample(ReceiptManageExample receiptManageExample) {
+        return modelMapper.countByExample(receiptManageExample);
+    }
+
+    @Override
+    public int deleteByExample(ReceiptManageExample receiptManageExample) {
+        return modelMapper.deleteByExample(receiptManageExample);
+    }
+
+    public ReceiptManageExample getCondition(ReceiptManage model){
+
+        ReceiptManageExample example = new ReceiptManageExample();
+        example.setOrderByClause("created_at");
+        ReceiptManageExample.Criteria criteria = example.createCriteria();
+        if(StringUtils.isNotEmpty(model.getHouseName())){
+            criteria.andHouseNameLike("%" + model.getHouseName() + "%");
+        }
+        return example;
+    }
+
+
+
+
+}

+ 386 - 0
pro-base/src/main/resources/mybatis/invoice/ReceiptManageMapper.xml

@@ -0,0 +1,386 @@
+<?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.idea.invoice.mapper.ReceiptManageMapper">
+  <resultMap id="BaseResultMap" type="com.idea.invoice.model.ReceiptManage">
+    <id column="id" jdbcType="VARCHAR" property="id" />
+    <result column="customer_management_id" jdbcType="VARCHAR" property="customerManagementId" />
+    <result column="business_id" jdbcType="VARCHAR" property="businessId" />
+    <result column="batch_number" jdbcType="VARCHAR" property="batchNumber" />
+    <result column="room_selection_number" jdbcType="VARCHAR" property="roomSelectionNumber" />
+    <result column="house_name" jdbcType="VARCHAR" property="houseName" />
+    <result column="buyer_name" jdbcType="VARCHAR" property="buyerName" />
+    <result column="receipt_type" jdbcType="VARCHAR" property="receiptType" />
+    <result column="receipt_money" jdbcType="DECIMAL" property="receiptMoney" />
+    <result column="receipt_number" jdbcType="VARCHAR" property="receiptNumber" />
+    <result column="receipt_status" jdbcType="INTEGER" property="receiptStatus" />
+    <result column="association_number" jdbcType="VARCHAR" property="associationNumber" />
+    <result column="created_id" jdbcType="VARCHAR" property="createdId" />
+    <result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
+    <result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
+    <result column="updated_id" jdbcType="VARCHAR" property="updatedId" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <where>
+      <foreach collection="oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause">
+    <where>
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List">
+    id, customer_management_id, business_id, batch_number, room_selection_number, house_name, 
+    buyer_name, receipt_type, receipt_money, receipt_number, receipt_status, association_number, 
+    created_id, created_at, updated_at, updated_id
+  </sql>
+  <select id="selectByExample" parameterType="com.idea.invoice.model.ReceiptManageExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from receipt_manage
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+  </select>
+  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from receipt_manage
+    where id = #{id,jdbcType=VARCHAR}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
+    delete from receipt_manage
+    where id = #{id,jdbcType=VARCHAR}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.idea.invoice.model.ReceiptManageExample">
+    delete from receipt_manage
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.idea.invoice.model.ReceiptManage">
+    insert into receipt_manage (id, customer_management_id, business_id, 
+      batch_number, room_selection_number, house_name, 
+      buyer_name, receipt_type, receipt_money, 
+      receipt_number, receipt_status, association_number, 
+      created_id, created_at, updated_at, 
+      updated_id)
+    values (#{id,jdbcType=VARCHAR}, #{customerManagementId,jdbcType=VARCHAR}, #{businessId,jdbcType=VARCHAR}, 
+      #{batchNumber,jdbcType=VARCHAR}, #{roomSelectionNumber,jdbcType=VARCHAR}, #{houseName,jdbcType=VARCHAR}, 
+      #{buyerName,jdbcType=VARCHAR}, #{receiptType,jdbcType=VARCHAR}, #{receiptMoney,jdbcType=DECIMAL}, 
+      #{receiptNumber,jdbcType=VARCHAR}, #{receiptStatus,jdbcType=INTEGER}, #{associationNumber,jdbcType=VARCHAR}, 
+      #{createdId,jdbcType=VARCHAR}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, 
+      #{updatedId,jdbcType=VARCHAR})
+  </insert>
+  <insert id="insertSelective" parameterType="com.idea.invoice.model.ReceiptManage">
+    insert into receipt_manage
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="customerManagementId != null">
+        customer_management_id,
+      </if>
+      <if test="businessId != null">
+        business_id,
+      </if>
+      <if test="batchNumber != null">
+        batch_number,
+      </if>
+      <if test="roomSelectionNumber != null">
+        room_selection_number,
+      </if>
+      <if test="houseName != null">
+        house_name,
+      </if>
+      <if test="buyerName != null">
+        buyer_name,
+      </if>
+      <if test="receiptType != null">
+        receipt_type,
+      </if>
+      <if test="receiptMoney != null">
+        receipt_money,
+      </if>
+      <if test="receiptNumber != null">
+        receipt_number,
+      </if>
+      <if test="receiptStatus != null">
+        receipt_status,
+      </if>
+      <if test="associationNumber != null">
+        association_number,
+      </if>
+      <if test="createdId != null">
+        created_id,
+      </if>
+      <if test="createdAt != null">
+        created_at,
+      </if>
+      <if test="updatedAt != null">
+        updated_at,
+      </if>
+      <if test="updatedId != null">
+        updated_id,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=VARCHAR},
+      </if>
+      <if test="customerManagementId != null">
+        #{customerManagementId,jdbcType=VARCHAR},
+      </if>
+      <if test="businessId != null">
+        #{businessId,jdbcType=VARCHAR},
+      </if>
+      <if test="batchNumber != null">
+        #{batchNumber,jdbcType=VARCHAR},
+      </if>
+      <if test="roomSelectionNumber != null">
+        #{roomSelectionNumber,jdbcType=VARCHAR},
+      </if>
+      <if test="houseName != null">
+        #{houseName,jdbcType=VARCHAR},
+      </if>
+      <if test="buyerName != null">
+        #{buyerName,jdbcType=VARCHAR},
+      </if>
+      <if test="receiptType != null">
+        #{receiptType,jdbcType=VARCHAR},
+      </if>
+      <if test="receiptMoney != null">
+        #{receiptMoney,jdbcType=DECIMAL},
+      </if>
+      <if test="receiptNumber != null">
+        #{receiptNumber,jdbcType=VARCHAR},
+      </if>
+      <if test="receiptStatus != null">
+        #{receiptStatus,jdbcType=INTEGER},
+      </if>
+      <if test="associationNumber != null">
+        #{associationNumber,jdbcType=VARCHAR},
+      </if>
+      <if test="createdId != null">
+        #{createdId,jdbcType=VARCHAR},
+      </if>
+      <if test="createdAt != null">
+        #{createdAt,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updatedAt != null">
+        #{updatedAt,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updatedId != null">
+        #{updatedId,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.idea.invoice.model.ReceiptManageExample" resultType="java.lang.Long">
+    select count(*) from receipt_manage
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update receipt_manage
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=VARCHAR},
+      </if>
+      <if test="record.customerManagementId != null">
+        customer_management_id = #{record.customerManagementId,jdbcType=VARCHAR},
+      </if>
+      <if test="record.businessId != null">
+        business_id = #{record.businessId,jdbcType=VARCHAR},
+      </if>
+      <if test="record.batchNumber != null">
+        batch_number = #{record.batchNumber,jdbcType=VARCHAR},
+      </if>
+      <if test="record.roomSelectionNumber != null">
+        room_selection_number = #{record.roomSelectionNumber,jdbcType=VARCHAR},
+      </if>
+      <if test="record.houseName != null">
+        house_name = #{record.houseName,jdbcType=VARCHAR},
+      </if>
+      <if test="record.buyerName != null">
+        buyer_name = #{record.buyerName,jdbcType=VARCHAR},
+      </if>
+      <if test="record.receiptType != null">
+        receipt_type = #{record.receiptType,jdbcType=VARCHAR},
+      </if>
+      <if test="record.receiptMoney != null">
+        receipt_money = #{record.receiptMoney,jdbcType=DECIMAL},
+      </if>
+      <if test="record.receiptNumber != null">
+        receipt_number = #{record.receiptNumber,jdbcType=VARCHAR},
+      </if>
+      <if test="record.receiptStatus != null">
+        receipt_status = #{record.receiptStatus,jdbcType=INTEGER},
+      </if>
+      <if test="record.associationNumber != null">
+        association_number = #{record.associationNumber,jdbcType=VARCHAR},
+      </if>
+      <if test="record.createdId != null">
+        created_id = #{record.createdId,jdbcType=VARCHAR},
+      </if>
+      <if test="record.createdAt != null">
+        created_at = #{record.createdAt,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.updatedAt != null">
+        updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.updatedId != null">
+        updated_id = #{record.updatedId,jdbcType=VARCHAR},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    update receipt_manage
+    set id = #{record.id,jdbcType=VARCHAR},
+      customer_management_id = #{record.customerManagementId,jdbcType=VARCHAR},
+      business_id = #{record.businessId,jdbcType=VARCHAR},
+      batch_number = #{record.batchNumber,jdbcType=VARCHAR},
+      room_selection_number = #{record.roomSelectionNumber,jdbcType=VARCHAR},
+      house_name = #{record.houseName,jdbcType=VARCHAR},
+      buyer_name = #{record.buyerName,jdbcType=VARCHAR},
+      receipt_type = #{record.receiptType,jdbcType=VARCHAR},
+      receipt_money = #{record.receiptMoney,jdbcType=DECIMAL},
+      receipt_number = #{record.receiptNumber,jdbcType=VARCHAR},
+      receipt_status = #{record.receiptStatus,jdbcType=INTEGER},
+      association_number = #{record.associationNumber,jdbcType=VARCHAR},
+      created_id = #{record.createdId,jdbcType=VARCHAR},
+      created_at = #{record.createdAt,jdbcType=TIMESTAMP},
+      updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
+      updated_id = #{record.updatedId,jdbcType=VARCHAR}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.idea.invoice.model.ReceiptManage">
+    update receipt_manage
+    <set>
+      <if test="customerManagementId != null">
+        customer_management_id = #{customerManagementId,jdbcType=VARCHAR},
+      </if>
+      <if test="businessId != null">
+        business_id = #{businessId,jdbcType=VARCHAR},
+      </if>
+      <if test="batchNumber != null">
+        batch_number = #{batchNumber,jdbcType=VARCHAR},
+      </if>
+      <if test="roomSelectionNumber != null">
+        room_selection_number = #{roomSelectionNumber,jdbcType=VARCHAR},
+      </if>
+      <if test="houseName != null">
+        house_name = #{houseName,jdbcType=VARCHAR},
+      </if>
+      <if test="buyerName != null">
+        buyer_name = #{buyerName,jdbcType=VARCHAR},
+      </if>
+      <if test="receiptType != null">
+        receipt_type = #{receiptType,jdbcType=VARCHAR},
+      </if>
+      <if test="receiptMoney != null">
+        receipt_money = #{receiptMoney,jdbcType=DECIMAL},
+      </if>
+      <if test="receiptNumber != null">
+        receipt_number = #{receiptNumber,jdbcType=VARCHAR},
+      </if>
+      <if test="receiptStatus != null">
+        receipt_status = #{receiptStatus,jdbcType=INTEGER},
+      </if>
+      <if test="associationNumber != null">
+        association_number = #{associationNumber,jdbcType=VARCHAR},
+      </if>
+      <if test="createdId != null">
+        created_id = #{createdId,jdbcType=VARCHAR},
+      </if>
+      <if test="createdAt != null">
+        created_at = #{createdAt,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updatedAt != null">
+        updated_at = #{updatedAt,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updatedId != null">
+        updated_id = #{updatedId,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where id = #{id,jdbcType=VARCHAR}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.idea.invoice.model.ReceiptManage">
+    update receipt_manage
+    set customer_management_id = #{customerManagementId,jdbcType=VARCHAR},
+      business_id = #{businessId,jdbcType=VARCHAR},
+      batch_number = #{batchNumber,jdbcType=VARCHAR},
+      room_selection_number = #{roomSelectionNumber,jdbcType=VARCHAR},
+      house_name = #{houseName,jdbcType=VARCHAR},
+      buyer_name = #{buyerName,jdbcType=VARCHAR},
+      receipt_type = #{receiptType,jdbcType=VARCHAR},
+      receipt_money = #{receiptMoney,jdbcType=DECIMAL},
+      receipt_number = #{receiptNumber,jdbcType=VARCHAR},
+      receipt_status = #{receiptStatus,jdbcType=INTEGER},
+      association_number = #{associationNumber,jdbcType=VARCHAR},
+      created_id = #{createdId,jdbcType=VARCHAR},
+      created_at = #{createdAt,jdbcType=TIMESTAMP},
+      updated_at = #{updatedAt,jdbcType=TIMESTAMP},
+      updated_id = #{updatedId,jdbcType=VARCHAR}
+    where id = #{id,jdbcType=VARCHAR}
+  </update>
+</mapper>