Commit 2c5ebb54 by 吴迪

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

parent 1e90dda6
...@@ -92,12 +92,10 @@ public class BranchController { ...@@ -92,12 +92,10 @@ public class BranchController {
@Login @Login
@RequestMapping("/api/getList") @RequestMapping("/api/getBranchDetail")
// @RequiresPermissions("manage:shortcode:delete") // @RequiresPermissions("manage:shortcode:delete")
public R getList(){ public R getBranchDetail(@RequestBody Map<String,String> params){
return R.ok().put("data",branchService.getBranchDetail(params.get("branchCode")));
return R.ok().put("data",branchService.list());
} }
} }
...@@ -2,7 +2,9 @@ package io.office.modules.manage.dao; ...@@ -2,7 +2,9 @@ package io.office.modules.manage.dao;
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.vo.response.BranchEntityVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/** /**
* ${comments} * ${comments}
...@@ -13,5 +15,9 @@ import org.apache.ibatis.annotations.Mapper; ...@@ -13,5 +15,9 @@ import org.apache.ibatis.annotations.Mapper;
*/ */
@Mapper @Mapper
public interface BranchDao extends BaseMapper<BranchEntity> { public interface BranchDao extends BaseMapper<BranchEntity> {
BranchEntityVo getBranchDetail (@Param("branchCode") String branchCode);
} }
...@@ -3,6 +3,8 @@ package io.office.modules.manage.service; ...@@ -3,6 +3,8 @@ package io.office.modules.manage.service;
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;
import io.office.modules.manage.vo.response.BranchEntityVo;
import org.apache.ibatis.annotations.Param;
import java.util.Map; import java.util.Map;
...@@ -16,5 +18,8 @@ import java.util.Map; ...@@ -16,5 +18,8 @@ import java.util.Map;
public interface BranchService extends IService<BranchEntity> { public interface BranchService extends IService<BranchEntity> {
PageUtils queryPage(Map<String, Object> params); PageUtils queryPage(Map<String, Object> params);
BranchEntityVo getBranchDetail (String branchCode);
} }
package io.office.modules.manage.service.impl; package io.office.modules.manage.service.impl;
import io.office.modules.manage.vo.response.BranchEntityVo;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Map; import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
...@@ -26,4 +27,9 @@ public class BranchServiceImpl extends ServiceImpl<BranchDao, BranchEntity> impl ...@@ -26,4 +27,9 @@ public class BranchServiceImpl extends ServiceImpl<BranchDao, BranchEntity> impl
return new PageUtils(page); 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 @@ ...@@ -18,6 +18,20 @@
</resultMap> </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