Browse Source

update

Signed-off-by: anderx <312518615@qq.com>
anderx 5 years ago
parent
commit
9672a433c3

+ 2 - 0
src/main/java/com/goafanti/common/dao/SoftWritingPriceMapper.java

@@ -96,4 +96,6 @@ public interface SoftWritingPriceMapper {
 
 	List<SoftWritingPrice> checkSoftWritingPrice(@Param("s")SoftWritingPrice s);
 
+	int selectCountByCid(Integer cid);
+
 }

+ 5 - 0
src/main/java/com/goafanti/common/mapper/SoftWritingPriceMapper.xml

@@ -339,4 +339,9 @@
 	and a.material=#{s.material}
 	and a.urgent=#{s.urgent}
   </select>
+  <select id="selectCountByCid"  resultType="java.lang.Integer">
+  select count(*) 
+  from soft_writing_price a where  status=0
+  and  cid= #{cid}
+  </select>
 </mapper>

+ 2 - 1
src/main/java/com/goafanti/organization/service/impl/ThirdPartyCompanyServiceImpl.java

@@ -679,7 +679,8 @@ public class ThirdPartyCompanyServiceImpl extends  BaseMybatisDao<ThirdPartyComp
 	@Override
 	public int deleteSoftWritingPrice(Integer id) {
 		SoftWritingPrice sw=softWritingPriceMapper.selectByPrimaryKey(id);
-		if (sw.getCid()!=null) {
+		int i=softWritingPriceMapper.selectCountByCid(sw.getCid());
+		if (i==1) {
 			companyLibraryMapper.deleteByPrimaryKey(sw.getCid());
 		}
 		return softWritingPriceMapper.deleteByPrimaryKey(id);