拉卡拉银行搜索,带出区域code 和 name
This commit is contained in:
parent
98275e1593
commit
3f35de9507
@ -9,9 +9,8 @@
|
||||
package com.suisung.mall.shop.lakala.controller.mobile;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.suisung.mall.common.api.CommonResult;
|
||||
import com.suisung.mall.common.modules.lakala.LklBanks;
|
||||
import com.suisung.mall.common.service.impl.BaseControllerImpl;
|
||||
import com.suisung.mall.shop.lakala.service.LklBanksService;
|
||||
import com.suisung.mall.shop.lakala.service.impl.LklTkServiceImpl;
|
||||
@ -26,6 +25,7 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Map;
|
||||
|
||||
@Api(tags = "拉卡拉商户进件控制器")
|
||||
@RestController
|
||||
@ -50,7 +50,8 @@ public class LklTkController extends BaseControllerImpl {
|
||||
@ApiOperation(value = "搜索国内银行(支行)分页列表", notes = "搜索国内银行(支行)分页列表,数据包含有效的收款结清行号")
|
||||
@RequestMapping(value = "/bank/search", method = RequestMethod.POST)
|
||||
public CommonResult searchLklBanksPageList(@RequestBody JSONObject paramsJSON) {
|
||||
Page<LklBanks> list = lklBanksService.searchBranchBanksPageList(paramsJSON.getStr("keyword"), paramsJSON.getInt("pageNum"), paramsJSON.getInt("pageSize"));
|
||||
// Page<LklBanks> list = lklBanksService.searchBranchBanksPageList(paramsJSON.getStr("keyword"), paramsJSON.getInt("pageNum"), paramsJSON.getInt("pageSize"));
|
||||
IPage<Map> list = lklBanksService.pageBranchBanksList("", "", 2, paramsJSON.getStr("keyword"), paramsJSON.getInt("pageNum"), paramsJSON.getInt("pageSize"));
|
||||
return CommonResult.success(list);
|
||||
}
|
||||
|
||||
|
||||
@ -9,10 +9,18 @@
|
||||
package com.suisung.mall.shop.lakala.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.suisung.mall.common.modules.lakala.LklBanks;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@Repository
|
||||
public interface LklBanksMapper extends BaseMapper<LklBanks> {
|
||||
|
||||
IPage<Map> pageBranchBanksList(Page<Map> page, @Param("bankNo") String bankNo, @Param("branchBankNo") String branchBankNo, @Param("type") Integer type, @Param("keywords") List<String> keywords);
|
||||
}
|
||||
|
||||
@ -8,9 +8,12 @@
|
||||
|
||||
package com.suisung.mall.shop.lakala.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.suisung.mall.common.modules.lakala.LklBanks;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface LklBanksService {
|
||||
|
||||
/**
|
||||
@ -22,4 +25,7 @@ public interface LklBanksService {
|
||||
* @return
|
||||
*/
|
||||
Page<LklBanks> searchBranchBanksPageList(String keyword, Integer pageNum, Integer pageSize);
|
||||
|
||||
|
||||
IPage<Map> pageBranchBanksList(String bankNo, String branchBankNo, Integer type, String keyword, Integer pageNum, Integer pageSize);
|
||||
}
|
||||
|
||||
@ -10,6 +10,7 @@ package com.suisung.mall.shop.lakala.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.suisung.mall.common.constant.CommonConstant;
|
||||
import com.suisung.mall.common.modules.lakala.LklBanks;
|
||||
@ -22,6 +23,7 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
@ -30,6 +32,9 @@ public class LklBanksServiceImpl extends BaseServiceImpl<LklBanksMapper, LklBank
|
||||
@Resource
|
||||
private JiebaUtils jiebaUtils;
|
||||
|
||||
@Resource
|
||||
private LklBanksMapper lklBanksMapper;
|
||||
|
||||
/**
|
||||
* 根据关键字查询有效记录分页列表
|
||||
*
|
||||
@ -73,4 +78,19 @@ public class LklBanksServiceImpl extends BaseServiceImpl<LklBanksMapper, LklBank
|
||||
|
||||
return lists(queryWrapper, pageNum, pageSize);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bankNo
|
||||
* @param branchBankNo
|
||||
* @param type
|
||||
* @param keyword
|
||||
* @param pageNum
|
||||
* @param pageSize
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public IPage<Map> pageBranchBanksList(String bankNo, String branchBankNo, Integer type, String keyword, Integer pageNum, Integer pageSize) {
|
||||
Page<Map> page = new Page<>(pageNum, pageSize);
|
||||
return lklBanksMapper.pageBranchBanksList(page, bankNo, branchBankNo, type, jiebaUtils.segmentForSearch(keyword));
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,4 +5,45 @@
|
||||
<sql id="Base_Column_List">
|
||||
*
|
||||
</sql>
|
||||
|
||||
<select id="pageBranchBanksList" resultType="Map">
|
||||
SELECT c.area_code province_code,c.area_name province_name,
|
||||
b.area_code city_code,b.area_name city_name,
|
||||
CONCAT(c.area_code, '/', b.area_code) as district,
|
||||
CONCAT(c.area_name, '/', b.area_name) as area,
|
||||
a.bank_no,a.branch_bank_no,a.branch_bank_name,a.branch_bank_no,a.clear_no
|
||||
FROM lkl_banks a
|
||||
JOIN lkl_area b on b.area_code=a.area_code
|
||||
JOIN lkl_area c on c.area_code=b.parent_code and c.type=b.type
|
||||
<where>
|
||||
<if test="bankNo!=null and bankNo!=''">
|
||||
and bank_no = #{bankNo}
|
||||
</if>
|
||||
|
||||
<if test="branchBankNo!=null and branchBankNo!=''">
|
||||
and branch_bank_no = #{branchBankNo}
|
||||
</if>
|
||||
|
||||
<if test="branchBankNo!=null and branchBankNo!=''">
|
||||
and branch_bank_no = #{branchBankNo}
|
||||
</if>
|
||||
|
||||
<choose>
|
||||
<when test="type!=null and type>0">
|
||||
and b.type = #{type}
|
||||
</when>
|
||||
<otherwise>
|
||||
and b.type = 2
|
||||
</otherwise>
|
||||
</choose>
|
||||
|
||||
<if test="keywords!=null and keywords.size>0">
|
||||
AND (
|
||||
<foreach collection="keywords" item="keyword" separator="AND">
|
||||
branch_bank_name LIKE CONCAT('%', #{keyword}, '%')
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user