ZeroLiYi před 1 rokem
rodič
revize
24e2b3ed77

+ 2 - 0
src/main/java/com/chinaitop/depot/sqr/mapper/BizSqrEnterpriseApplyMapper.java

@@ -31,6 +31,8 @@ public interface BizSqrEnterpriseApplyMapper {
31 31
 
32 32
     BizSqrEnterpriseApplyVO findById(Map map);
33 33
 
34
+    BizSqrEnterpriseApplyVO findById1(Map map);
35
+
34 36
     int insert(BizSqrEnterpriseApply bizSqrEnterpriseApply);
35 37
 
36 38
     int selectRequestfindByApplyId(String id);

+ 19 - 0
src/main/java/com/chinaitop/depot/sqr/mapper/BizSqrEnterpriseApplyMapper.xml

@@ -123,6 +123,25 @@
123 123
 
124 124
     </select>
125 125
 
126
+    <select id="findById1" resultType="Map" resultMap="BaseResultMap">
127
+        SELECT
128
+        bgqa.id, A.dwmc,A.id unitInfoId, A.dwdm,A.fddbr,A.dwlx,A.zcdz,A.cfs,A.ygs,A.DICT_LABEL,bgqa.apply_status,bgqa.apply_type,
129
+        bse.certified_storekeeper_count ,bse.certified_inspector_count ,bse.warehouse_facility_situation ,
130
+        bse.full_time_staff_count ,bgqa.storage_expire_time ,bgqa.attachment attachment,bgqa.sqr_enterprise_id
131
+        FROM
132
+        province_all.biz_sqr_enterprise_apply bgqa
133
+        left join province_all.biz_sqr_enterprise  bse on bgqa.sqr_enterprise_id =bse.id
134
+        left join(select bui.id,bui.dwmc,bui.dwdm,bui.fddbr,bui.dwlx,bui.zcdz,bui.cfs,bui.ygs,dict.DICT_LABEL  from province_all.biz_unit_info bui left join province_all.dev_dict dict on bui.dwlx = dict.id
135
+        <if test="unitInfoId != null and unitInfoId != ''">
136
+            where bui.id =#{unitInfoId,jdbcType=VARCHAR}
137
+        </if>
138
+
139
+        )A  on bgqa.unit_info_id = A.id
140
+        where bgqa.id=#{id,jdbcType=INTEGER} and bgqa.apply_type=#{applyType,jdbcType=INTEGER}
141
+
142
+    </select>
143
+
144
+
126 145
     <insert id="insert" keyProperty="id" useGeneratedKeys="true"  parameterType="com.chinaitop.depot.sqr.model.BizSqrEnterpriseApply">
127 146
         insert into province_all.biz_sqr_enterprise_apply (id,unit_info_id,apply_type,
128 147
                                               apply_status,storage_expire_time,sqr_enterprise_id,

+ 13 - 4
src/main/java/com/chinaitop/depot/sqr/service/impl/BizSqrEnterpriseApplyServiceImpl.java

@@ -79,10 +79,18 @@ public class BizSqrEnterpriseApplyServiceImpl implements BizSqrEnterpriseApplySe
79 79
     @Override
80 80
     public BizSqrEnterpriseApplyVO findById(Integer applyType,String unitInfoId,Integer id){
81 81
         Map map =new HashMap<>();
82
-        map.put("id",id);
83
-        map.put("applyType",applyType);
84
-        map.put("unitInfoId",unitInfoId);
85
-        return bizSqrEnterpriseApplyMapper.findById(map);
82
+        if(applyType==1){
83
+            map.put("id",id);
84
+            map.put("applyType",applyType);
85
+            map.put("unitInfoId",unitInfoId);
86
+            return bizSqrEnterpriseApplyMapper.findById(map);
87
+        }else{
88
+            map.put("id",id);
89
+            map.put("applyType",applyType);
90
+            map.put("unitInfoId",unitInfoId);
91
+            return bizSqrEnterpriseApplyMapper.findById1(map);
92
+        }
93
+
86 94
     }
87 95
 
88 96
     @Override
@@ -197,6 +205,7 @@ public class BizSqrEnterpriseApplyServiceImpl implements BizSqrEnterpriseApplySe
197 205
             bizSqrEnterpriseApply.setUpdateTime(new Date());
198 206
             return bizSqrEnterpriseApplyMapper.insert(bizSqrEnterpriseApply);
199 207
         }
208
+
200 209
         bizSqrEnterpriseApply.setCreateTime(new Date());
201 210
         bizSqrEnterpriseApply.setUpdateTime(new Date());
202 211
         return bizSqrEnterpriseApplyMapper.insert(bizSqrEnterpriseApply);