Commit 531e5f94 by 吴迪

【修改】修改代码

parent f22f8a3c
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<swagger.version>2.7.0</swagger.version> <swagger.version>2.7.0</swagger.version>
<joda.time.version>2.9.9</joda.time.version> <joda.time.version>2.9.9</joda.time.version>
<gson.version>2.8.5</gson.version> <gson.version>2.8.5</gson.version>
<fastjson.version>1.2.72</fastjson.version> <fastjson.version>1.2.83</fastjson.version>
<hutool.version>4.1.1</hutool.version> <hutool.version>4.1.1</hutool.version>
<lombok.version>1.18.4</lombok.version> <lombok.version>1.18.4</lombok.version>
......
...@@ -3,7 +3,9 @@ package io.office.modules.manage.controller; ...@@ -3,7 +3,9 @@ package io.office.modules.manage.controller;
import java.util.Arrays; import java.util.Arrays;
import java.util.Map; import java.util.Map;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.office.modules.app.annotation.Login; import io.office.modules.app.annotation.Login;
import io.office.modules.manage.entity.DocEntity;
import io.office.modules.manage.vo.request.ShortCodeVo; import io.office.modules.manage.vo.request.ShortCodeVo;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -39,10 +41,11 @@ public class BranchController { ...@@ -39,10 +41,11 @@ public class BranchController {
*/ */
@RequestMapping("/list") @RequestMapping("/list")
// @RequiresPermissions("manage:branch:list") // @RequiresPermissions("manage:branch:list")
public R list(@RequestParam Map<String, Object> params){ public R list(@RequestBody Map<String, Object> params){
PageUtils page = branchService.queryPage(params); Page<DocEntity> page = this.branchService.getListPage(params,
new Page(Integer.parseInt(params.get("page").toString()), Integer.parseInt(params.get("limit").toString())));
return R.ok().put("page", page); PageUtils pageUtils = new PageUtils(page);
return R.ok().put("page", pageUtils);
} }
...@@ -54,7 +57,7 @@ public class BranchController { ...@@ -54,7 +57,7 @@ public class BranchController {
public R info(@PathVariable("branchCode") String branchCode){ public R info(@PathVariable("branchCode") String branchCode){
BranchEntity branch = branchService.getById(branchCode); BranchEntity branch = branchService.getById(branchCode);
return R.ok().put("branch", branch); return R.ok().put("data", branch);
} }
/** /**
......
package io.office.modules.manage.dao; package io.office.modules.manage.dao;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.office.modules.manage.entity.BranchEntity; import io.office.modules.manage.entity.BranchEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.office.modules.manage.entity.dto.NewsParams;
import io.office.modules.manage.vo.response.BranchEntityVo; import io.office.modules.manage.vo.response.BranchEntityVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/** /**
* ${comments} * ${comments}
* *
...@@ -20,4 +25,7 @@ public interface BranchDao extends BaseMapper<BranchEntity> { ...@@ -20,4 +25,7 @@ public interface BranchDao extends BaseMapper<BranchEntity> {
BranchEntityVo getBranchDetail (@Param("branchCode") String branchCode); BranchEntityVo getBranchDetail (@Param("branchCode") String branchCode);
List<BranchEntityVo> getListPage(@Param("params") Map<String,Object> params, Page page);
} }
package io.office.modules.manage.entity.dto;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import java.io.Serializable;
/**
*
* 
 @description:
*
* @author wudi
* @date 14:05 2022/5/23
*/
@Data
public class CodeagentVo implements Serializable {
private static final long serialVersionUID = 1L;
/**
* $column.comments
*/
@TableId
private Integer id;
/**
* $column.comments
*/
private String title;
/**
* $column.comments
*/
private String content;
/**
* $column.comments
*/
private String address;
/**
* $column.comments
*/
private String phone;
/**
* $column.comments
*/
private String postcode;
/**
* $column.comments
*/
private String contactman;
/**
* $column.comments
*/
private String fax;
/**
* $column.comments
*/
private String description;
/**
* $column.comments
*/
private String mail;
/**
* $column.comments
*/
private String website;
/**
* $column.comments
*/
private String addressDescription;
}
package io.office.modules.manage.service; package io.office.modules.manage.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import io.office.common.utils.PageUtils; import io.office.common.utils.PageUtils;
import io.office.modules.manage.entity.BranchEntity; import io.office.modules.manage.entity.BranchEntity;
...@@ -21,5 +22,9 @@ public interface BranchService extends IService<BranchEntity> { ...@@ -21,5 +22,9 @@ public interface BranchService extends IService<BranchEntity> {
BranchEntityVo getBranchDetail (String branchCode); BranchEntityVo getBranchDetail (String branchCode);
Page getListPage(Map<String, Object> params,Page page);
} }
package io.office.modules.manage.service.impl; package io.office.modules.manage.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.office.modules.manage.entity.DocEntity;
import io.office.modules.manage.vo.response.BranchEntityVo; import io.office.modules.manage.vo.response.BranchEntityVo;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map; import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
...@@ -32,4 +38,11 @@ public class BranchServiceImpl extends ServiceImpl<BranchDao, BranchEntity> impl ...@@ -32,4 +38,11 @@ public class BranchServiceImpl extends ServiceImpl<BranchDao, BranchEntity> impl
return baseMapper.getBranchDetail(branchCode); return baseMapper.getBranchDetail(branchCode);
} }
@Override
public Page getListPage(Map<String, Object> params, Page page) {
List<BranchEntityVo> list = baseMapper.getListPage(params,page);
page.setRecords(list);
return page;
}
} }
\ No newline at end of file
...@@ -48,6 +48,19 @@ spring: ...@@ -48,6 +48,19 @@ spring:
config: config:
multi-statement-allow: true multi-statement-allow: true
dynamic:
datasource:
slave1:
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
url: jdbc:sqlserver://118.190.181.128:51433;DatabaseName=gs108
username: sa
password: 1234.abcd
slave2:
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
url: jdbc:sqlserver://118.190.181.128:51433;DatabaseName=gs108
username: sa
password: 1234.abcd
##多数据源的配置 ##多数据源的配置
#dynamic: #dynamic:
# datasource: # datasource:
......
...@@ -18,7 +18,8 @@ ...@@ -18,7 +18,8 @@
</resultMap> </resultMap>
<select id="getBranchDetail" parameterType="string" resultType="io.office.modules.manage.vo.response.BranchEntityVo" > <select id="getBranchDetail" parameterType="string"
resultType="io.office.modules.manage.vo.response.BranchEntityVo">
SELECT SELECT
a.*, b.description, a.*, b.description,
b.mail, b.mail,
...@@ -33,7 +34,22 @@ ...@@ -33,7 +34,22 @@
branch_code = #{branchCode} branch_code = #{branchCode}
</select> </select>
<select id="getListPage" resultType="io.office.modules.manage.vo.response.BranchEntityVo">
SELECT
a.*, b.description,
b.mail,
b.website
FROM
center_outer.dbo.branch a
LEFT JOIN codeagent b ON a.branch_code = b.id
WHERE
branch_code &lt;&gt; '0000'
<if test="params.branchName!=null and params.branchName!=''">
and a.branch_name like concat('%',#{params.branchName},'%')
</if>
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -20,4 +20,8 @@ ...@@ -20,4 +20,8 @@
</resultMap> </resultMap>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment