Commit 2c5ebb54 by 吴迪

【新增】分支机构详情描述接口

parent 1e90dda6
......@@ -92,12 +92,10 @@ public class BranchController {
@Login
@RequestMapping("/api/getList")
@RequestMapping("/api/getBranchDetail")
// @RequiresPermissions("manage:shortcode:delete")
public R getList(){
return R.ok().put("data",branchService.list());
public R getBranchDetail(@RequestBody Map<String,String> params){
return R.ok().put("data",branchService.getBranchDetail(params.get("branchCode")));
}
}
......@@ -2,7 +2,9 @@ package io.office.modules.manage.dao;
import io.office.modules.manage.entity.BranchEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.office.modules.manage.vo.response.BranchEntityVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* ${comments}
......@@ -13,5 +15,9 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface BranchDao extends BaseMapper<BranchEntity> {
BranchEntityVo getBranchDetail (@Param("branchCode") String branchCode);
}
......@@ -3,6 +3,8 @@ package io.office.modules.manage.service;
import com.baomidou.mybatisplus.extension.service.IService;
import io.office.common.utils.PageUtils;
import io.office.modules.manage.entity.BranchEntity;
import io.office.modules.manage.vo.response.BranchEntityVo;
import org.apache.ibatis.annotations.Param;
import java.util.Map;
......@@ -16,5 +18,8 @@ import java.util.Map;
public interface BranchService extends IService<BranchEntity> {
PageUtils queryPage(Map<String, Object> params);
BranchEntityVo getBranchDetail (String branchCode);
}
package io.office.modules.manage.service.impl;
import io.office.modules.manage.vo.response.BranchEntityVo;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
......@@ -26,4 +27,9 @@ public class BranchServiceImpl extends ServiceImpl<BranchDao, BranchEntity> impl
return new PageUtils(page);
}
@Override
public BranchEntityVo getBranchDetail(String branchCode) {
return baseMapper.getBranchDetail(branchCode);
}
}
\ No newline at end of file
package io.office.modules.manage.vo.response;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import java.io.Serializable;
/**
*
* 
 @description:
*
* @author wudi
* @date 11:39 2021/12/8
*/
@Data
public class BranchEntityVo implements Serializable {
private static final long serialVersionUID = 1L;
private String branchCode;
private String branchName;
private String branchAddress;
private String branchPostcode;
private String branchContact;
private String tel1;
private String tel2;
private String fax;
private String rockkey;
private String branchSimname;
private String description;
private String mail;
private String website;
private String addressDescription;
private String personname;
}
......@@ -18,6 +18,20 @@
</resultMap>
<select id="getBranchDetail" parameterType="string" resultType="io.office.modules.manage.vo.response.BranchEntityVo" >
SELECT
a.*, b.description,
b.mail,
b.website,
b.address_description,
c.personname
FROM
center_outer.dbo.branch a
LEFT JOIN codeagent b ON a.branch_code = b.Id
LEFT JOIN center_outer.dbo.person c ON a.branch_contact = c.personid
WHERE
branch_code = #{branchCode}
</select>
......
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