2
0

2 Commits 029b2ab7d2 ... 3d9c76a1b4

Autor SHA1 Nachricht Datum
  171250443 3d9c76a1b4 Merge branch 'master' of http://175.27.189.80:3000/souguang/sg_zjjg_sjqy vor 1 Jahr
  171250443 b6d01527c0 no message vor 1 Jahr

+ 3 - 5
src/main/java/com/cool/bang/modules/mysql/domain/Project.java

@@ -99,8 +99,6 @@ public class Project {
             return 2;
         }
         switch (data) {
-            case -1:
-                return 0;
             case 1:
                 return 1;
             default:
@@ -108,11 +106,11 @@ public class Project {
         }
     }
 
-    private Integer stateSwitch(Integer data) {
-        if (data == null) { //如果为空默认为正在监管状态
+    private Integer stateSwitch(Integer type) {
+        if (type == null) { //如果为空默认为正在监管状态
             return 3;
         }
-        switch (data) {
+        switch (type) {
             case 0:
                 return 0;
             case 1:

+ 17 - 5
src/main/java/com/cool/bang/modules/mysql/domain/Relieve.java

@@ -2,6 +2,7 @@ package com.cool.bang.modules.mysql.domain;
 
 import com.cool.bang.modules.mysql.domain.flowPo.ApprovalRecord;
 import com.cool.bang.modules.oracle.domain.AregItem;
+import com.cool.bang.modules.oracle.domain.OracleRelieve;
 import com.cool.bang.modules.oracle.domain.po.Jgxmjc;
 import com.sun.istack.internal.NotNull;
 
@@ -24,7 +25,7 @@ public class Relieve {
     private String businessNumber;
 
     /** 企业主键 */
-    private Long orgId;
+    private Integer orgId;
 
     /** 企业名称 */
     private String orgName;
@@ -59,7 +60,7 @@ public class Relieve {
     /** 解除楼幢 */
     private String relieveBuilding;
 
-    /** 业务类型 1监管 2托管 */
+    /** 业务类型 1托管 2监管 */
     private Integer businessType;
 
     /** 业务状态 1发起申请 2正在审核 3申请成功 4申请退回 */
@@ -74,9 +75,20 @@ public class Relieve {
 
     public Relieve(){}
 
+    public Relieve(OracleRelieve relieve) {
+        this.businessNumber = relieve.getBusinessNumber();
+        this.director = relieve.getDirector();
+        this.phone = relieve.getPhone();
+        this.businessType = relieve.getAccountType() == 1 ? 1 : 2;
+        this.createTime = relieve.getCreateTime();
+        this.updateTime = relieve.getUpdateTime();
+        this.delFlag = 1;
+
+    }
+
     public Relieve(Jgxmjc jgxmjc,Org org,Project project){
         this.businessNumber = jgxmjc.getYwbh();
-        this.orgId = Long.valueOf(org.getId());
+        //this.orgId = Long.valueOf(org.getId());
         this.orgName = org.getOrgName();
         this.projectId = project.getId();
         this.projectNumber = project.getProjectNumber();
@@ -137,11 +149,11 @@ public class Relieve {
         this.businessNumber = businessNumber;
     }
 
-    public Long getOrgId() {
+    public Integer getOrgId() {
         return orgId;
     }
 
-    public void setOrgId(Long orgId) {
+    public void setOrgId(Integer orgId) {
         this.orgId = orgId;
     }
 

+ 15 - 10
src/main/java/com/cool/bang/modules/mysql/domain/SuperviseRelieve.java

@@ -1,6 +1,7 @@
 package com.cool.bang.modules.mysql.domain;
 
 import com.cool.bang.common.util.DateUtil;
+import com.cool.bang.modules.oracle.domain.OracleRelieve;
 import com.cool.bang.modules.oracle.domain.po.Jgxmjc;
 import com.cool.bang.modules.oracle.domain.po.Jgyw;
 
@@ -92,24 +93,28 @@ public class SuperviseRelieve {
 //        this.updateTime = DateUtil.strToDate(jgyw.getSpsj(),"yyyy-MM-dd HH:mm:ss");
 //    }
 
-    public SuperviseRelieve(Account account, Org org, ProjectAccount projectAccount, Jgxmjc jgxmjc){
-        this.businessNumber = jgxmjc.getYwbh();
+    public SuperviseRelieve(Account account, Org org, Project project, OracleRelieve param) {
+        this.businessNumber = param.getBusinessNumber();
+        this.createTime = param.getCreateTime();
+        this.updateTime = param.getUpdateTime();
+
         this.bankCode = account.getBankCode();
-        this.orgId = org.getId();
-        this.orgName = org.getOrgName();
-        this.projectAccountId = projectAccount.getId();
-        this.projectNumber = projectAccount.getProjectNumber();
-        this.projectName = projectAccount.getProjectName();
-        this.projectAddress = projectAccount.getProjectAddress();
         this.accountId = account.getId();
         this.bankName = account.getBankName();
         this.name = account.getName();
         this.account = account.getAccount();
         this.accountOpenAddress = account.getOpenAddress();
+
+        this.orgId = org.getId();
+        this.orgName = org.getOrgName();
+
+        this.projectAccountId = project.getId();
+        this.projectNumber = project.getProjectNumber();
+        this.projectName = project.getProjectName();
+        this.projectAddress = project.getProjectAddress();
+
         this.businessState = 2;
         this.delFlag = 1;
-        this.createTime = jgxmjc.getSqrq();
-        this.updateTime = jgxmjc.getShrq();
     }
 
 

+ 6 - 1
src/main/java/com/cool/bang/modules/mysql/mapper/MySqlMapper.java

@@ -18,7 +18,7 @@ public interface MySqlMapper {
      */
     int insertSuperviseBusiness(@Param("list") List<SuperviseBusiness> superviseBusinessList);
 
-    int insertSuperviseRelieve(@Param("list") List<SuperviseRelieve> superviseRelieveList);
+    int insertSuperviseRelieve(@Param("list") String bankAccount);
 
     int insertSuperviseTo(SuperviseTo superviseTo);
 
@@ -42,6 +42,11 @@ public interface MySqlMapper {
 
     int insertRelieve(Relieve relieve);
 
+    /**
+     * 更新楼幢字符串
+     */
+    int updateRelieveBuilding(@Param("id") Long id, @Param("relieveBuilding") String relieveBuilding);
+
     int insertRelieveDetail(@Param("list") List<RelieveDetail> relieveDetailList);
 
     int insertContract(@Param("list") List<Contract> contracts);

+ 1 - 1
src/main/java/com/cool/bang/modules/mysql/mapper/ProjectMapper.java

@@ -30,7 +30,7 @@ public interface ProjectMapper {
      */
     Integer selectProjectHouseTotal(String projectNumber);
 
-    int updateRelieve(Long projectId);
+    int updateRelieve(@Param("id")Long id, @Param("state")Integer state);
 
     /**
      * 更新项目监管楼幢数量

+ 111 - 65
src/main/java/com/cool/bang/modules/mysql/service/MySQLService.java

@@ -376,13 +376,14 @@ public class MySQLService {
     }
 
     /**
-     * 监管项目解除
+     * 项目解除,账户解除
      */
     @Transactional
     public void relieve() {
-        List<Jgxmjc> jgxmjcList = applyMapper.selectJgxmjc();
-        List<SuperviseRelieve> superviseRelieveList = new ArrayList<>();
-        ApprovalFlow approvalFlow = flowMapper.selectFlowByType(7);//解除申请flowid = 7
+        List<OracleRelieve> oracleRelieves = applyMapper.selectRelieves();
+
+        // 查询审批流程
+        ApprovalFlow approvalFlow = flowMapper.selectFlowByType(7); // 解除申请flowId = 7
         List<ApprovalNode> nodes = flowMapper.selectNodeByFlowNumber(approvalFlow.getFlowNumber());
         ApprovalNode endNode = new ApprovalNode();
         for (ApprovalNode node : nodes) {
@@ -390,81 +391,126 @@ public class MySQLService {
                 endNode = node;
             }
         }
-        List<ApprovalRecord> recordList = new ArrayList<>();
 
-        for (Jgxmjc jgxmjc : jgxmjcList) {
-            Org org = qyxxMapper.selectOrgByMisid(jgxmjc.getQybh());
-            Project project = projectMapper.selectByProjectNumber(jgxmjc.getXmbh());
-            ProjectAccount projectAccount = projectAccountMapper.selectByAregid(jgxmjc.getAregid());
-            List<Areg> aregList = applyMapper.selectByXmbhFromAreg(jgxmjc.getXmbh());
-            //项目解除业务信息
-            Relieve relieve = new Relieve(jgxmjc, org, project);
+        for (OracleRelieve oracleRelieve : oracleRelieves) {
+
+            // 审核不通过的,不导入
+            if (oracleRelieve.getFlowState().equals(1) &&
+                    oracleRelieve.getFlowNodeName().equals("解除监管初审不通过")) {
+                continue;
+            }
+
+            Relieve relieve = new Relieve(oracleRelieve);
+
+            // 申请未审核的导入
+            if (oracleRelieve.getFlowState().equals(1) &&
+                    oracleRelieve.getFlowNodeName().equals("解除监管申请上报")) {
+                relieve.setBusinessState(1);
+            } else if (oracleRelieve.getFlowState().equals(1)) {
+                throw new RuntimeException("解除项目异常:" + oracleRelieve.getFlowNodeName());
+            }
+
+            // 审核已完成
+            if (oracleRelieve.getFlowState().equals(0)) {
+                relieve.setBusinessState(3);
+            }
+
+            Org org = qyxxMapper.selectOrgByMisid(oracleRelieve.getOrgMisId());
+            relieve.setOrgId(org.getId());
+            relieve.setOrgName(org.getOrgName());
+
+            Project project = projectMapper.selectByProjectNumber(oracleRelieve.getProjectNumber());
+            relieve.setProjectId(project.getId());
+            relieve.setProjectNumber(project.getProjectNumber());
+            relieve.setProjectName(project.getProjectName());
+
             relieve.setFlowNumber(approvalFlow.getFlowNumber());
             relieve.setFlowNodeId(endNode.getId());
             relieve.setFlowNodeName(endNode.getNodeName());
-            if (aregList.size() == 1) {//说明该项目下所有的项目虚拟户都已经解除,可以解除项目、项目虚拟户、账户、楼幢
-                relieve.setRelieveType(1);
-                mySqlMapper.insertRelieve(relieve);
-                projectMapper.updateRelieve(relieve.getProjectId());
-            } else { //说明该项目下存在还没有解除的项目虚拟户,所以只解除该项目虚拟户、以及该项目虚拟户绑定的账户、楼幢
-                relieve.setRelieveType(2);
-                mySqlMapper.insertRelieve(relieve);
-            }
-            //项目虚拟户变更解除状态
-            projectAccountMapper.updateRelieveByAregid(jgxmjc.getAregid(), jgxmjc.getSqrq());
-            //监管账户解除业务信息
-            if (jgxmjc.getAccountList() != null && jgxmjc.getAccountList().size() > 0) {
-                for (Account account : jgxmjc.getAccountList()) {
-                    account = accountMapper.selectByAccountNO(account.getAccount());
-                    SuperviseRelieve superviseRelieve = new SuperviseRelieve(account, org, projectAccount, jgxmjc);
-                    superviseRelieveList.add(superviseRelieve);
-                    //更新账户解除日期
-                    accountMapper.updateCancelDate(account.getId(), superviseRelieve.getUpdateTime());
+
+            // 判断项目虚拟户是否已全部解除
+            List<Areg> list = applyMapper.selectIsRelieve(relieve.getProjectNumber());
+            if (list.size() == 1) {
+                relieve.setRelieveType(1); // 项目解除
+                // 如果是未审核通过的,改为解除中
+                if (oracleRelieve.getFlowState().equals(1)) {
+                    projectMapper.updateRelieve(relieve.getProjectId(), 2);
+                } else {
+                    projectMapper.updateRelieve(relieve.getProjectId(), 0);
                 }
+            } else {
+                relieve.setRelieveType(2);
             }
-            //解除明细
-            List<RelieveDetail> relieveDetailList = new ArrayList<>();
-            if (jgxmjc.getAregItemList() != null && jgxmjc.getAregItemList().size() > 0) {
-                for (AregItem aregItem : jgxmjc.getAregItemList()) {
-                    BuildingAccount buildingAccount = buildingAccountMapper.selectByBuildingNumber(aregItem.getLzbh());
-                    RelieveDetail relieveDetail = new RelieveDetail(buildingAccount);
+            mySqlMapper.insertRelieve(relieve);
+
+            // ------------------------------ 项目解除详情 ----------------------------------
+
+            List<RelieveDetail> relieveDetails = new ArrayList<>();
+            List<OracleRelieveDetail> oracleRelieveDetails = applyMapper.selectRelieveDetails(oracleRelieve.getAppId());
+            if (oracleRelieveDetails != null  && oracleRelieveDetails.size() > 0
+                    && oracleRelieveDetails.get(0) != null  && !StringUtils.isEmpty(oracleRelieveDetails.get(0).getBuildingNumber())) {
+                StringBuilder relieveBuilding = new StringBuilder();
+                for (OracleRelieveDetail detail : oracleRelieveDetails) {
+                    BuildingAccount building = buildingAccountMapper.selectByBuildingNumber(detail.getBuildingNumber());
+                    RelieveDetail relieveDetail = new RelieveDetail(building);
                     relieveDetail.setRelieveId(relieve.getId());
-                    relieveDetailList.add(relieveDetail);
+                    relieveDetails.add(relieveDetail);
+                    relieveBuilding.append(building.getBuildingName()).append(",");
                 }
-                mySqlMapper.insertRelieveDetail(relieveDetailList);
-                buildingAccountMapper.updateRelieve(relieveDetailList, jgxmjc.getShrq());
+                String buildingNames = relieveBuilding.toString().substring(0, relieveBuilding.length() -1);
+                mySqlMapper.updateRelieveBuilding(relieve.getId(), buildingNames);
+                mySqlMapper.insertRelieveDetail(relieveDetails);
+                buildingAccountMapper.updateRelieve(relieveDetails, relieve.getUpdateTime());
             }
-            //审批流程
-            if (jgxmjc.getsFlowList() != null && jgxmjc.getsFlowList().size() > 0) {
-                for (SFlow sFlow : jgxmjc.getsFlowList()) {
-                    ApprovalRecord record = new ApprovalRecord();
-                    record.setBusinessNumber(relieve.getBusinessNumber());
-                    record.setFlowNumber(relieve.getFlowNumber());
-                    record.setTableId(relieve.getId());
-                    record.setApprovalTime(sFlow.getShsj());
-                    record.setApprovalRemark(sFlow.getBz());
-                    record.setCreateTime(record.getApprovalTime());
-                    record.setUpdateTime(record.getApprovalTime());
-                    record.setDelFlag(1);
-                    if (sFlow.getShzt() == null) {
-                        record.setNodeName("申请节点");
-                        record.setApprover(relieve.getOrgName() + "(" + sFlow.getShr() + ")");
+
+
+            // ------------------------------ 项目解除审批记录 ----------------------------------
+
+            List<ApprovalRecord> approvalRecords = new ArrayList<>();
+            List<OracleApprovalRecord> oracleApprovalRecords =  applyMapper.selectRelieveRecord(oracleRelieve.getAppId());
+            for (OracleApprovalRecord approval : oracleApprovalRecords) {
+                ApprovalRecord record = new ApprovalRecord();
+                record.setBusinessNumber(relieve.getBusinessNumber());
+                record.setFlowNumber(relieve.getFlowNumber());
+                record.setTableId(relieve.getId());
+                record.setApprovalTime(approval.getApprovalTime());
+                record.setApprovalRemark(approval.getRemark());
+                record.setCreateTime(record.getApprovalTime());
+                record.setUpdateTime(record.getApprovalTime());
+                record.setDelFlag(1);
+                if (StringUtils.isEmpty(approval.getApprovalStatus())) {
+                    record.setNodeName("申请节点");
+                    record.setApprover(relieve.getOrgName() + "(" + approval.getApprover() + ")");
+                } else {
+                    record.setNodeName(approval.getNodeName());
+                    record.setApprover("监管部门(" + approval.getApprover() + ")");
+                    if (approval.getApprovalStatus().equals("1")) {
+                        record.setApprovalStatus(1);
                     } else {
-                        record.setNodeName(sFlow.getLcmc());
-                        record.setApprover("监管部门(" + sFlow.getShr() + ")");
-                        if (sFlow.getShzt() == 1) {
-                            record.setApprovalStatus(1);
-                        } else {
-                            record.setApprovalStatus(2);
-                        }
+                        record.setApprovalStatus(2);
                     }
-                    recordList.add(record);
+                }
+                approvalRecords.add(record);
+            }
+            flowMapper.insertRecordBatch(approvalRecords);
+
+            // ------------------------------ 监管账户解除 ----------------------------------
+
+            /*
+             * 查询oracle监管账户,根据监管账户查询mysql账户信息,声明监管账户解除业务并插入mysql,更新账户表账户解除日期
+             */
+            List<OracleAccount> oracleAccounts = applyMapper.selectRelieveSuperviseAccount(oracleRelieve.getAppId());
+
+            for (OracleAccount oracleAccount : oracleAccounts) {
+                if (oracleAccount != null && StringUtils.isEmpty(oracleAccount.getAccount())) {
+                    Account account = accountMapper.selectByAccountNO(oracleAccount.getAccount());
+                    SuperviseRelieve superviseRelieve = new SuperviseRelieve(account, org, project, oracleRelieve);
+                    mySqlMapper.insertSuperviseRelieve(oracleAccount.getAccount());
+                    // 更新账户解除日期
+                    accountMapper.updateCancelDate(account.getId(), superviseRelieve.getUpdateTime());
                 }
             }
         }
-        mySqlMapper.insertSuperviseRelieve(superviseRelieveList);
-        recordList.forEach(item -> System.out.println(">>>>>> item ===" + item));
-        flowMapper.insertRecordBatch(recordList);
     }
 
     /**

+ 20 - 0
src/main/java/com/cool/bang/modules/oracle/domain/OracleAccount.java

@@ -0,0 +1,20 @@
+package com.cool.bang.modules.oracle.domain;
+
+/**
+ * 描述:
+ *
+ * @author PeiZhi Guo
+ * 2023-3-16 17:25
+ */
+public class OracleAccount {
+
+    private String account;
+
+    public String getAccount() {
+        return account;
+    }
+
+    public void setAccount(String account) {
+        this.account = account;
+    }
+}

+ 146 - 0
src/main/java/com/cool/bang/modules/oracle/domain/OracleRelieve.java

@@ -0,0 +1,146 @@
+package com.cool.bang.modules.oracle.domain;
+
+import java.util.Date;
+
+/**
+ * 描述:
+ *
+ * @author PeiZhi Guo
+ * 2023-3-16 15:17
+ */
+public class OracleRelieve {
+
+    private Integer appId;
+
+    private String businessNumber;
+
+    private String director;
+
+    private String phone;
+
+    // 申请时间
+    private Date createTime;
+
+    // 审批时间
+    private Date updateTime;
+
+    // 0 已完成 1未完成
+    private Integer flowState;
+
+    private String flowNodeName;
+
+    private Integer orgMisId;
+
+    private Integer aregId;
+
+    private String projectName;
+
+    private String projectNumber;
+
+    // 账户类型 0 监管 1托管
+    private Integer accountType;
+
+    public Integer getAppId() {
+        return appId;
+    }
+
+    public void setAppId(Integer appId) {
+        this.appId = appId;
+    }
+
+    public String getBusinessNumber() {
+        return businessNumber;
+    }
+
+    public void setBusinessNumber(String businessNumber) {
+        this.businessNumber = businessNumber;
+    }
+
+    public String getDirector() {
+        return director;
+    }
+
+    public void setDirector(String director) {
+        this.director = director;
+    }
+
+    public String getPhone() {
+        return phone;
+    }
+
+    public void setPhone(String phone) {
+        this.phone = phone;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public Integer getFlowState() {
+        return flowState;
+    }
+
+    public void setFlowState(Integer flowState) {
+        this.flowState = flowState;
+    }
+
+    public Integer getOrgMisId() {
+        return orgMisId;
+    }
+
+    public void setOrgMisId(Integer orgMisId) {
+        this.orgMisId = orgMisId;
+    }
+
+    public Integer getAregId() {
+        return aregId;
+    }
+
+    public void setAregId(Integer aregId) {
+        this.aregId = aregId;
+    }
+
+    public String getProjectName() {
+        return projectName;
+    }
+
+    public void setProjectName(String projectName) {
+        this.projectName = projectName;
+    }
+
+    public String getProjectNumber() {
+        return projectNumber;
+    }
+
+    public void setProjectNumber(String projectNumber) {
+        this.projectNumber = projectNumber;
+    }
+
+    public Integer getAccountType() {
+        return accountType;
+    }
+
+    public void setAccountType(Integer accountType) {
+        this.accountType = accountType;
+    }
+
+    public String getFlowNodeName() {
+        return flowNodeName;
+    }
+
+    public void setFlowNodeName(String flowNodeName) {
+        this.flowNodeName = flowNodeName;
+    }
+}

+ 20 - 0
src/main/java/com/cool/bang/modules/oracle/domain/OracleRelieveDetail.java

@@ -0,0 +1,20 @@
+package com.cool.bang.modules.oracle.domain;
+
+/**
+ * 描述:
+ *
+ * @author PeiZhi Guo
+ * 2023-3-16 16:59
+ */
+public class OracleRelieveDetail {
+
+    private String buildingNumber;
+
+    public String getBuildingNumber() {
+        return buildingNumber;
+    }
+
+    public void setBuildingNumber(String buildingNumber) {
+        this.buildingNumber = buildingNumber;
+    }
+}

+ 11 - 6
src/main/java/com/cool/bang/modules/oracle/mapper/ApplyMapper.java

@@ -1,9 +1,6 @@
 package com.cool.bang.modules.oracle.mapper;
 
-import com.cool.bang.modules.oracle.domain.Areg;
-import com.cool.bang.modules.oracle.domain.OracleAppropriation;
-import com.cool.bang.modules.oracle.domain.OracleAppropriationDetail;
-import com.cool.bang.modules.oracle.domain.OracleApprovalRecord;
+import com.cool.bang.modules.oracle.domain.*;
 import com.cool.bang.modules.oracle.domain.po.Bfxx;
 import com.cool.bang.modules.oracle.domain.po.Jgxmjc;
 import com.cool.bang.modules.oracle.domain.po.Jgyw;
@@ -44,9 +41,17 @@ public interface ApplyMapper {
      * 监管项目解除
      * @return
      */
-    List<Jgxmjc> selectJgxmjc();
+    List<OracleRelieve> selectRelieves();
+
+    List<OracleRelieveDetail> selectRelieveDetails(Integer appId);
+
+    List<OracleApprovalRecord> selectRelieveRecord(Integer appId);
+
+    List<OracleAccount> selectRelieveSuperviseAccount(Integer appId);
+
+    List<Areg> selectIsRelieve(String projectNumber);
+
 
-    List<Areg> selectByXmbhFromAreg(String xmbh);
 
     //-----------------
 

+ 11 - 7
src/main/resources/mapper/mysql/BuildingAccountMapper.xml

@@ -29,17 +29,21 @@
     </update>
 
     <select id="selectByBuildingNumber" resultType="com.cool.bang.modules.mysql.domain.BuildingAccount">
-        select
-            id, building_number as buildingNumber, building_name as buildingName
-        from
+        SELECT
+            id,
+            building_id AS buildingId,
+            building_number AS buildingNumber,
+            building_name AS buildingName,
+            building_address AS buildingAddress,
+            build_area AS buildArea,
+            account_balance AS accountBalance,
+            in_transit_fund AS inTransitFund
+        FROM
             fc_building_account
-        where
+        WHERE
             building_number = #{buildingNumber}
     </select>
 
-
-
-
     <select id="getInfoByLZBH" resultType="com.cool.bang.modules.mysql.domain.BuildingAccount">
         select
         id, building_number as buildingNumber, building_name as buildingName ,building_id AS buildingId,

+ 6 - 0
src/main/resources/mapper/mysql/MySQLMapper.xml

@@ -207,6 +207,12 @@
                 #{businessState}, #{remark}, #{createTime}, #{updateTime}, #{delFlag})
     </insert>
 
+    <!--  插入项目解除监管业务数据  -->
+    <insert id="updateRelieveBuilding">
+        update fc_relieve set relieve_building = #{relieveBuilding} where id = #{id}
+    </insert>
+
+
     <!--  插入项目解除监管业务详情数据  -->
     <insert id="insertRelieveDetail">
         insert into

+ 1 - 1
src/main/resources/mapper/mysql/ProjectMapper.xml

@@ -35,7 +35,7 @@
 
     <!--  变更项目状态为已解除  -->
     <update id="updateRelieve">
-        update fc_project set state = 0 where id = #{id}
+        update fc_project set state = #{state} where id = #{id}
     </update>
 
     <update id="updateBuildTotal">

+ 56 - 16
src/main/resources/mapper/oracle/ApplyMapper.xml

@@ -58,26 +58,66 @@
             <result property="account"           column="accountno"         jdbcType="VARCHAR"/>
         </collection>
     </resultMap>
-    <select id="selectJgxmjc" resultMap="JgxmjcMap">
+
+    <select id="selectRelieves" resultType="com.cool.bang.modules.oracle.domain.OracleRelieve">
+        SELECT
+            t.appid as appId,
+            t.appbh AS businessNumber,
+            t.jbr AS director,
+            t.lxdh AS phone,
+            t.sqsj AS createTime,
+            t.spjssj AS updateTime,
+            TO_NUMBER(t.flowstate) AS flowState,
+            t.FLOWNODENAME as flowNodeName,
+            t2.qybh AS orgMisId,
+            t2.aregid AS aregId,
+            t2.xmmc as projectName,
+            t2.xmbh AS projectNumber,
+            t2.jglx AS accountType
+        FROM
+            apply t
+            LEFT JOIN areg t2 ON t.aregid = t2.aregid
+        WHERE
+            t.apptype = 4 AND t.state = 1 order by t.sqsj, t2.aregId
+    </select>
+
+    <select id="selectRelieveDetails" resultType="com.cool.bang.modules.oracle.domain.OracleRelieveDetail">
+        SELECT
+            t2.lzbh as buildingNumber
+        FROM
+            apply t1
+            LEFT JOIN aregitem t2 ON t1.aregid = t2.aregid AND t2.jiechuappid IS NULL
+        WHERE
+            t1.appid = #{appId}
+    </select>
+
+    <select id="selectRelieveRecord" resultType="com.cool.bang.modules.oracle.domain.OracleApprovalRecord">
         select
-            t1.appbh as ywbh,t2.qybh,t2.xmbh,t1.jbr as lxr,t1.lxdh,t2.jglx,t2.aregid,t1.sqsj as sqrq,t1.spjssj as shrq,
-            t3.flownodename as lcmc,t3.operatedate as lcshsj,t3.operator as shr,t3.remark as bz,t3.state as shzt,
-            t4.accountno,t5.lzbh,t5.lzmc
+            t5.flownodename as nodeName,
+            t5.operatedate as approvalTime,
+            t5.operator as approver,
+            t5.remark as remark,
+            t5.state as approvalStatus
         from
-            apply t1
-        left join
-            areg t2 on t1.aregid = t2.aregid
-        left join
-            sflowlog t3 on t3.infoid = t1.appid and t3.flowid = 3
-        left join
-            account t4 on t1.aregid = t4.aregid and t4.accountno is not null
-        left join
-            aregitem t5 on t1.aregid = t5.aregid and t5.jiechuappid is null
-        where t1.apptype = 4 and t1.state = 1 and t1.flowstate = 0
+            apply t
+            left join sflowlog t5 on t5.infoid = t.appid and t5.flowid = 3
+        where
+            t.apptype = 4 and t.state = 1 and t.appid = #{appId} order by t5.operatedate
+    </select>
+
+    <select id="selectRelieveSuperviseAccount" resultType="com.cool.bang.modules.oracle.domain.OracleAccount">
+        SELECT
+            t4.accountno as account
+        FROM
+            apply t1 LEFT JOIN account t4 ON t1.aregid = t4.aregid
+        WHERE
+            t1.appid = #{appId}
     </select>
 
-    <select id="selectByXmbhFromAreg" resultType="com.cool.bang.modules.oracle.domain.Areg">
-        select jgstate from areg where xmbh = #{xmbh} group by jgstate
+
+
+    <select id="selectIsRelieve" resultType="com.cool.bang.modules.oracle.domain.Areg">
+        select to_number(jgstate) as jgstate from areg where xmbh = #{projectNumber} group by jgstate
     </select>
 
     <!--  监管转托管业务数据  -->