Przeglądaj źródła

添加查询外部协议订单的保险公司列表数据接口

hxl13994548489 1 rok temu
rodzic
commit
eae28c3660

+ 13 - 2
src/main/java/com/ydtech/modules/esm/controller/EsmInsCompanyController.java

@@ -12,7 +12,6 @@ import com.ydtech.core.page.HttpResult;
 import com.ydtech.core.page.PageRequest;
 import com.ydtech.core.page.PageResult;
 import com.ydtech.exception.SystemException;
-import com.ydtech.modules.admin.model.SysDept;
 import com.ydtech.modules.base.controller.BaseController;
 import com.ydtech.modules.esm.model.EsmInsCompany;
 import com.ydtech.modules.esm.model.vo.req.EsmInsCompanyReq;
@@ -21,7 +20,6 @@ import com.ydtech.modules.esm.service.EsmInsCompanyService;
 import com.ydtech.modules.protocol.entity.po.PtlAgreement;
 import com.ydtech.modules.protocol.entity.vo.PtlAgreementPageVo;
 import com.ydtech.modules.protocol.service.PtlAgreementService;
-import com.ydtech.modules.protocol.service.impl.PtlAgreementServiceImpl;
 import com.ydtech.modules.protocol.utils.AssertionUtils;
 import com.ydtech.utils.StringUtils;
 import io.swagger.annotations.Api;
@@ -289,4 +287,17 @@ public class EsmInsCompanyController extends BaseController {
         List<EsmInsCompanyResVo> esmInsCompanyList = esmInsCompanyService.findOrderCompanyList();
         return HttpResult.ok(esmInsCompanyList);
     }
+
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/12/12 14:29
+     *  @Description:  获取外部协议的保险公司的集合
+     */
+    @PostMapping("/getExternalAgreementCompanyList")
+    @ApiOperation("获取外部协议的保险公司的集合")
+    public HttpResult<List<EsmInsCompanyResVo>> getExternalAgreementCompanyList(@RequestSingleParam("name") String name) {
+        List<EsmInsCompanyResVo> lst = esmInsCompanyService.getExternalAgreementCompanyList(name);
+        return HttpResult.ok(lst);
+    }
 }

+ 7 - 0
src/main/java/com/ydtech/modules/esm/dao/EsmInsCompanyMapper.java

@@ -36,4 +36,11 @@ public interface EsmInsCompanyMapper extends BaseMapper<EsmInsCompany> {
      *  @Description: 查询订单下的保险公司列表
      */
     List<EsmInsCompanyResVo> findOrderCompanyList();
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/12/12 14:34
+     *  @Description:  获取外部协议的公司列表
+     */
+    List<EsmInsCompanyResVo> getExternalAgreementCompanyList( @Param("name")  String name);
 }

+ 7 - 0
src/main/java/com/ydtech/modules/esm/service/EsmInsCompanyService.java

@@ -84,6 +84,13 @@ public interface EsmInsCompanyService extends IService<EsmInsCompany> {
      *  @Description:  通过保险公司名称或简称查询
      */
     public EsmInsCompany findInsCompanyByNameOrNamesimple(String companyName);
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/12/12 14:32
+     *  @Description:  获取外部协议的保险公司列表
+     */
+    List<EsmInsCompanyResVo> getExternalAgreementCompanyList(String name);
 }
 
 

+ 10 - 1
src/main/java/com/ydtech/modules/esm/service/impl/EsmInsCompanyServiceImpl.java

@@ -10,7 +10,6 @@ import com.ydtech.modules.esm.model.vo.res.EsmInsCompanyResVo;
 import com.ydtech.modules.esm.service.EsmInsCompanyService;
 import com.ydtech.modules.protocol.utils.AssertionUtils;
 import com.ydtech.utils.StringUtils;
-import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
 
 import java.util.ArrayList;
@@ -198,6 +197,16 @@ public class EsmInsCompanyServiceImpl extends ServiceImpl<EsmInsCompanyMapper, E
         }
         return null;
     }
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/12/12 14:33
+     *  @Description: 获取外部协议的保险公司列表
+     */
+    @Override
+    public List<EsmInsCompanyResVo> getExternalAgreementCompanyList(String name) {
+        return baseMapper.getExternalAgreementCompanyList(name);
+    }
 }
 
 

+ 17 - 0
src/main/resources/mapper/modules/esm/EsmInsCompanyMapper.xml

@@ -81,4 +81,21 @@
             ins.company_id,
             ins.inscompany
     </select>
+    <select id="getExternalAgreementCompanyList" resultType="com.ydtech.modules.esm.model.vo.res.EsmInsCompanyResVo">
+        SELECT DISTINCT
+            insurance_company_id AS id,
+            insurance_company AS NAME
+        FROM
+            ptl_agreement
+        <where>
+            is_external = '1'
+            <if test="name != null and name != ''">
+                and insurance_company like  concat('%',#{name},'%')
+            </if>
+
+        </where>
+        GROUP BY
+            insurance_company_id,
+            insurance_company
+    </select>
 </mapper>