tangzetong há 2 anos atrás
pai
commit
d3872cc505

+ 16 - 9
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/PoIssuerController.java

@@ -8,14 +8,7 @@ import io.swagger.annotations.ApiOperation;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
@@ -71,11 +64,25 @@ public class PoIssuerController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:issuer:query')")
     @GetMapping(value = "/{issuerId}")
     @ApiOperation("根据发行人编号获取详细信息")
-    public AjaxResult getInfo(@PathVariable("issuerId") Long issuerId)
+    public AjaxResult getInfo1(@PathVariable("issuerId") Long issuerId)
     {
         return success(poIssuerService.selectPoIssuerByIssuerId(issuerId));
     }
 
+    /**
+     * 根据名字进行模糊查询
+     */
+    @PreAuthorize("@ss.hasPermi('system:issuer:queryLike')")
+    @GetMapping(value = "/queryLike/{issuerName}")
+    @ApiOperation("根据发行人别名获取详细信息")
+    public TableDataInfo getInfo2(@RequestParam(value = "issuerName",
+            required = false) String issuerName)
+    {
+        startPage();
+        List<PoIssuer> poIssuer = poIssuerService.selectPoIssuerByIssuerName(issuerName);
+        return getDataTable(poIssuer);
+    }
+
     /**
      * 新增发行人
      */

+ 9 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/PoIssuerMapper.java

@@ -3,6 +3,7 @@ package com.ruoyi.system.mapper;
 import java.util.List;
 import com.ruoyi.system.domain.PoIssuer;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * 发行人Mapper接口
@@ -21,6 +22,14 @@ public interface PoIssuerMapper
      */
     public PoIssuer selectPoIssuerByIssuerId(Long issuerId);
 
+    /**
+     * 查询发行人信息
+     *
+     * @param issuerName 发行人ID
+     * @return 发行人信息
+     */
+    public List<PoIssuer> selectPoIssuerByIssuerName(@Param("issuerName") String issuerName);
+
     /**
      * 查询发行人列表
      *

+ 8 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/IPoIssuerService.java

@@ -58,4 +58,12 @@ public interface IPoIssuerService
      * @return
      */
     public int deletePoIssuerByIssuerId(Long issuerId);
+
+    /**
+     * 查询发行人
+     *
+     * @param issuerName 发行人ID
+     * @return 发行人信息
+     */
+    public List<PoIssuer> selectPoIssuerByIssuerName(String issuerName);
 }

+ 11 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PoIssuerServiceImpl.java

@@ -93,4 +93,15 @@ public class PoIssuerServiceImpl implements IPoIssuerService
     {
         return poIssuerMapper.deletePoIssuerByIssuerId(issuerId);
     }
+
+    /**
+     *
+     *
+     * @param issuerName 发行人ID
+     * @return 发行人信息
+     */
+    @Override
+    public List<PoIssuer> selectPoIssuerByIssuerName(String issuerName) {
+        return poIssuerMapper.selectPoIssuerByIssuerName(issuerName);
+    }
 }

+ 8 - 0
ruoyi-system/src/main/resources/mapper/system/PoIssuerMapper.xml

@@ -39,6 +39,14 @@
         where issuer_id = #{issuerId}
     </select>
 
+    <select id="selectPoIssuerByIssuerName"  resultType="PoIssuer" resultMap="PoIssuerResult">
+        <include refid="selectPoIssuerVo"/>
+       <where>
+           <if test="issuerName != null and issuerName != '' ">and issuer_name like concat('%', #{issuerName},'%')</if>
+       and del_flag = '0'
+       </where>
+    </select>
+
     <insert id="insertPoIssuer" parameterType="PoIssuer" useGeneratedKeys="true" keyProperty="issuerId">
         insert into po_issuer
         <trim prefix="(" suffix=")" suffixOverrides=",">