Browse Source

20221026_dongbing

dongbing 2 years ago
parent
commit
899d89e094

+ 3 - 1
ruoyi-modules/mz-business-xmsb/src/main/java/com/ruoyi/business/mapper/ZwywXmsbFjMapper.java

@@ -6,10 +6,12 @@ import com.ruoyi.common.datascope.utils.BaseMapperPlus;
 
 /**
  * 项目申报附件信息Mapper接口
- * 
+ *
  * @author sun
  * @date 2022-10-25
  */
 public interface ZwywXmsbFjMapper extends BaseMapperPlus<ZwywXmsbFj> {
 
+    //根据项目申报信息id删除关联附件信息
+    public int deleteFjByXmsbId(String id);
 }

+ 8 - 4
ruoyi-modules/mz-business-xmsb/src/main/java/com/ruoyi/business/service/impl/ZwywXmsbCommonServiceImpl.java

@@ -8,10 +8,7 @@ import com.ruoyi.business.domain.ZwywXmsbBaxx;
 import com.ruoyi.business.domain.ZwywXmsbCommon;
 import com.ruoyi.business.domain.ZwywXmsbXmbdpz;
 import com.ruoyi.business.domain.ZwywXmsbXmlx;
-import com.ruoyi.business.mapper.ZwywXmsbBaxxMapper;
-import com.ruoyi.business.mapper.ZwywXmsbCommonMapper;
-import com.ruoyi.business.mapper.ZwywXmsbXmbdpzMapper;
-import com.ruoyi.business.mapper.ZwywXmsbXmlxMapper;
+import com.ruoyi.business.mapper.*;
 import com.ruoyi.business.service.IZwywXmsbCommonService;
 import com.ruoyi.common.core.constant.SecurityConstants;
 import com.ruoyi.common.core.utils.StringUtils;
@@ -59,6 +56,9 @@ public class ZwywXmsbCommonServiceImpl implements IZwywXmsbCommonService
     @Autowired
     private ZwywXmsbBaxxMapper zwywXmsbBaxxMapper;
 
+    @Autowired
+    private ZwywXmsbFjMapper zwywXmsbFjMapper;
+
     /**
      * 查询项目申报信息
      *
@@ -174,6 +174,10 @@ public class ZwywXmsbCommonServiceImpl implements IZwywXmsbCommonService
     @Override
     public int deleteZwywXmsbCommonByIds(String[] ids)
     {
+        //项目申报信息id
+        String id = Arrays.asList(ids).get(0);
+        //根据项目申报信息id删除关联附件信息
+        zwywXmsbFjMapper.deleteFjByXmsbId(id);
         return zwywXmsbCommonMapper.deleteBatchIds(Arrays.asList(ids));
     }
 

+ 2 - 2
ruoyi-modules/mz-business-xmsb/src/main/resources/mapper/business/ZwywXmsbBaxxMapper.xml

@@ -26,8 +26,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <select id="getZwywXmsbBaxxListById" resultMap="ZwywXmsbBaxxResult">
-        select id,sbId,bazt,shyj,bz,createTimeStr,createUserId,createBy,createUserType,createAreaCode,createUnit,createUnitName,updateTimeStr,updateUserId,updateBy,updateUnit,updateUnitName,state
+        select id,sb_id,bazt,shyj,bz,create_time_str,create_user_id,create_by,create_user_type,create_area_code,create_unit,create_unit_name,update_time_str,update_user_id,update_by,update_unit,update_unit_name,state
         from zwyw_xmsb_baxx
-        where sbId = #{id}
+        where sb_id = #{id}
     </select>
 </mapper>

+ 5 - 2
ruoyi-modules/mz-business-xmsb/src/main/resources/mapper/business/ZwywXmsbFjMapper.xml

@@ -3,7 +3,7 @@
 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ruoyi.business.mapper.ZwywXmsbFjMapper">
-    
+
     <resultMap type="ZwywXmsbFj" id="ZwywXmsbFjResult">
         <result property="id"    column="id"    />
         <result property="sbId"    column="sb_id"    />
@@ -27,4 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="state"    column="state"    />
     </resultMap>
 
-</mapper>
+    <delete id="deleteFjByXmsbId" parameterType="String">
+        delete from zwyw_xmsb_fj where sb_id = #{id}
+    </delete>
+</mapper>