Browse Source

合同条款查询方法

liangbo.huang 2 months ago
parent
commit
d7429ef74b

+ 17 - 0
trade-service/src/main/java/com/trade/service/sales/service/ContractTermsService.java

@@ -13,4 +13,21 @@ import com.trade.service.sales.domain.ContractTerms;
  * @author: wanglang
  */
 public interface ContractTermsService extends IService<ContractTerms> {
+
+    /**
+     * 根据合同ID和合同类型获取合同条款信息
+     * 
+     * @param contractId
+     * @param contractType
+     * @return
+     */
+    ContractTerms getByContractIdAndType(Long contractId, String contractType);
+
+    /**
+     * 根据合同编号获取合同条款信息
+     * 
+     * @param contractNo
+     * @return
+     */
+    ContractTerms getByContractNo(String contractNo);
 }

+ 11 - 0
trade-service/src/main/java/com/trade/service/sales/service/impl/ContractTermsServiceImpl.java

@@ -17,4 +17,15 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  */
 @Service
 public class ContractTermsServiceImpl extends ServiceImpl<ContractTermsMapper, ContractTerms> implements ContractTermsService {
+
+    @Override
+    public ContractTerms getByContractIdAndType(Long contractId, String contractType) {
+        return this.lambdaQuery().eq(ContractTerms::getContractId, contractId)
+                .eq(ContractTerms::getContractType, contractType).one();
+    }
+
+    @Override
+    public ContractTerms getByContractNo(String contractNo) {
+        return this.lambdaQuery().eq(ContractTerms::getContractNo, contractNo).one();
+    }
 }