dcs 1 年之前
父节点
当前提交
d0097cc63d

+ 37 - 1
virgo.api/src/main/java/com/bosshand/virgo/api/model/PaymentInvoice.java

@@ -19,6 +19,13 @@ public class PaymentInvoice {
      */
     private long paymentId;
 
+    /**
+     * 组织id
+     */
+    private long organizationId;
+
+    private String organizationName;
+
     /**
      * 项目id
      */
@@ -32,10 +39,15 @@ public class PaymentInvoice {
     private Map<Long, String> roomMap;
 
     /**
-     * 发票类型
+     * 类型
      */
     private Integer type;
 
+    /**
+     * 发票类型
+     */
+    private Integer invoiceType;
+
     /**
      * 发票状态
      */
@@ -114,6 +126,22 @@ public class PaymentInvoice {
         this.paymentId = paymentId;
     }
 
+    public long getOrganizationId() {
+        return organizationId;
+    }
+
+    public void setOrganizationId(long organizationId) {
+        this.organizationId = organizationId;
+    }
+
+    public String getOrganizationName() {
+        return organizationName;
+    }
+
+    public void setOrganizationName(String organizationName) {
+        this.organizationName = organizationName;
+    }
+
     public long getProjectId() {
         return projectId;
     }
@@ -146,6 +174,14 @@ public class PaymentInvoice {
         this.type = type;
     }
 
+    public Integer getInvoiceType() {
+        return invoiceType;
+    }
+
+    public void setInvoiceType(Integer invoiceType) {
+        this.invoiceType = invoiceType;
+    }
+
     public Integer getStatus() {
         return status;
     }

+ 17 - 3
virgo.api/src/main/resources/mapper/PaymentInvoiceMapper.xml

@@ -9,9 +9,11 @@
         <result column="paymentOrdinaryId" property="paymentOrdinaryId"/>
         <result column="paymentId" property="paymentId"/>
 
+        <result column="organizationId" property="organizationId"/>
         <result column="projectId" property="projectId"/>
         <result column="projectItemTargetRoomIds" property="projectItemTargetRoomIds"/>
         <result column="type" property="type"/>
+        <result column="invoiceType" property="invoiceType"/>
         <result column="status" property="status"/>
         <result column="code" property="code"/>
         <result column="number" property="number"/>
@@ -30,9 +32,12 @@
         <result column="paymentOrdinaryId" property="paymentOrdinaryId"/>
         <result column="paymentId" property="paymentId"/>
 
+        <result column="organizationId" property="organizationId"/>
+        <result column="organizationName" property="organizationName"/>
         <result column="projectId" property="projectId"/>
         <result column="projectItemTargetRoomIds" property="projectItemTargetRoomIds"/>
         <result column="type" property="type"/>
+        <result column="invoiceType" property="invoiceType"/>
         <result column="status" property="status"/>
         <result column="code" property="code"/>
         <result column="number" property="number"/>
@@ -50,10 +55,10 @@
 
     <insert id="insert" parameterType="com.bosshand.virgo.api.model.PaymentInvoice" useGeneratedKeys="true" keyProperty="id">
         INSERT INTO  payment_invoice (`paymentOrdinaryId`, `paymentId`,
-                                      `projectId`, `projectItemTargetRoomIds`, `type`, `status`, `code`, `number`, `payMerchantId`, `payClientId`, `cargoName`,
+                                      `organizationId`, `projectId`, `projectItemTargetRoomIds`, `invoiceType`, `type`, `status`, `code`, `number`, `payMerchantId`, `payClientId`, `cargoName`,
                                       `name`, `date`, `attachment`, `data`)
         VALUES (#{paymentOrdinaryId}, #{paymentId},
-                #{projectId}, #{projectItemTargetRoomIds}, #{type}, #{status}, #{code}, #{number}, #{payMerchantId}, #{payClientId}, #{cargoName},
+                #{organizationId}, #{projectId}, #{projectItemTargetRoomIds}, #{invoiceType}, #{type}, #{status}, #{code}, #{number}, #{payMerchantId}, #{payClientId}, #{cargoName},
                 #{name}, #{date}, #{attachment}, #{data})
     </insert>
 
@@ -68,9 +73,11 @@
             <if test="paymentOrdinaryId!=0">paymentOrdinaryId=#{paymentOrdinaryId},</if>
             <if test="paymentId!=0">paymentId=#{paymentId},</if>
 
+            <if test="organizationId!=0">organizationId=#{organizationId},</if>
             <if test="projectId!=0">projectId=#{projectId},</if>
             <if test="projectItemTargetRoomIds!=null">projectItemTargetRoomIds=#{projectItemTargetRoomIds},</if>
             <if test="type!=null">type=#{type},</if>
+            <if test="invoiceType!=null">invoiceType=#{invoiceType},</if>
             <if test="status!=null">status=#{status},</if>
             <if test="code!=null">code=#{code},</if>
             <if test="number!=null">number=#{number},</if>
@@ -93,9 +100,11 @@
             <if test="paymentOrdinaryId!=0">and paymentOrdinaryId=#{paymentOrdinaryId}</if>
             <if test="paymentId!=0">and paymentId=#{paymentId}</if>
 
+            <if test="organizationId!=0">and organizationId=#{organizationId}</if>
             <if test="projectId!=0">and projectId=#{projectId}</if>
             <if test="projectItemTargetRoomIds!=null">and projectItemTargetRoomIds=#{projectItemTargetRoomIds}</if>
             <if test="type!=null">and type=#{type}</if>
+            <if test="invoiceType!=null">and invoiceType=#{invoiceType}</if>
             <if test="status!=null">and status=#{status}</if>
             <if test="code!=null">and code=#{code}</if>
             <if test="number!=null">and number=#{number},</if>
@@ -111,7 +120,8 @@
     </select>
 
     <sql id="query">
-        SELECT a.*, c.name as payMerchantName, d.name as payClientName FROM payment_invoice a
+        SELECT a.*, b.name as organizationName, c.name as payMerchantName, d.name as payClientName FROM payment_invoice a
+        LEFT JOIN mgr_organization b ON a.organizationId = b.id
         LEFT JOIN merchant c ON a.payMerchantId = c.id
         LEFT JOIN mgr_client d ON a.payClientId = d.id
     </sql>
@@ -122,9 +132,11 @@
             <if test="p.paymentOrdinaryId!=0">and a.paymentOrdinaryId=#{p.paymentOrdinaryId}</if>
             <if test="p.paymentId!=0">and a.paymentId=#{p.paymentId}</if>
 
+            <if test="p.organizationId!=0">and a.organizationId=#{p.organizationId}</if>
             <if test="p.projectId!=0">and a.projectId=#{p.projectId}</if>
             <if test="p.projectItemTargetRoomIds!=null">and a.projectItemTargetRoomIds=#{p.projectItemTargetRoomIds}</if>
             <if test="p.type!=null">and a.type=#{p.type}</if>
+            <if test="p.invoiceType!=null">and a.invoiceType=#{p.invoiceType}</if>
             <if test="p.status!=null">and a.status=#{p.status}</if>
             <if test="p.code!=null">and a.code=#{p.code}</if>
             <if test="p.number!=null">and a.number=#{p.number},</if>
@@ -146,9 +158,11 @@
             <if test="paymentOrdinaryId!=0">and paymentOrdinaryId=#{paymentOrdinaryId}</if>
             <if test="paymentId!=0">and paymentId=#{paymentId}</if>
 
+            <if test="organizationId!=0">and organizationId=#{organizationId}</if>
             <if test="projectId!=0">and projectId=#{projectId}</if>
             <if test="projectItemTargetRoomIds!=null">and projectItemTargetRoomIds=#{projectItemTargetRoomIds}</if>
             <if test="type!=null">and type=#{type}</if>
+            <if test="invoiceType!=null">and invoiceType=#{invoiceType}</if>
             <if test="status!=null">and status=#{status}</if>
             <if test="code!=null">and code=#{code}</if>
             <if test="number!=null">and number=#{number},</if>