提交 23c6b021 编写于 作者: ibizdev's avatar ibizdev

xignzi006 发布系统代码

上级 547144c8
......@@ -19,6 +19,7 @@ import com.alibaba.fastjson.JSONObject;
public interface Ir_attachmentMapper extends BaseMapper<Ir_attachment>{
Page<Ir_attachment> searchByRes(IPage page, @Param("srf") Ir_attachmentSearchContext context, @Param("ew") Wrapper<Ir_attachment> wrapper) ;
Page<Ir_attachment> searchDefault(IPage page, @Param("srf") Ir_attachmentSearchContext context, @Param("ew") Wrapper<Ir_attachment> wrapper) ;
@Override
Ir_attachment selectById(Serializable id);
......
......@@ -37,6 +37,7 @@ public interface IIr_attachmentService extends IService<Ir_attachment>{
boolean checkKey(Ir_attachment et) ;
boolean save(Ir_attachment et) ;
void saveBatch(List<Ir_attachment> list) ;
Page<Ir_attachment> searchByRes(Ir_attachmentSearchContext context) ;
Page<Ir_attachment> searchDefault(Ir_attachmentSearchContext context) ;
List<Ir_attachment> selectByCompanyId(Long id) ;
void removeByCompanyId(Long id) ;
......
......@@ -199,6 +199,15 @@ public class Ir_attachmentServiceImpl extends EBSServiceImpl<Ir_attachmentMapper
}
/**
* 查询集合 ByRes
*/
@Override
public Page<Ir_attachment> searchByRes(Ir_attachmentSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<Ir_attachment> pages=baseMapper.searchByRes(context.getPages(),context,context.getSelectCond());
return new PageImpl<Ir_attachment>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
* 查询集合 数据集
*/
......
......@@ -34,6 +34,15 @@
where company_id=#{id}
</select>
<!--数据集合[ByRes]-->
<select id="searchByRes" parameterType="cn.ibizlab.businesscentral.core.odoo_ir.filter.Ir_attachmentSearchContext" resultMap="Ir_attachmentResultMap">
select t1.* from (
<include refid="ByRes" />
)t1
<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.businesscentral.core.odoo_ir.filter.Ir_attachmentSearchContext" resultMap="Ir_attachmentResultMap">
select t1.* from (
......@@ -43,6 +52,12 @@
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据查询[ByRes]-->
<sql id="ByRes" databaseId="postgresql">
<![CDATA[ SELECT t1.ACCESS_TOKEN, t1.CHECKSUM, t1.COMPANY_ID, t1.FILE_SIZE, t1.ID, t1.KEY, t1.MIMETYPE, t1.NAME, t1.PUBLIC, t1.RES_FIELD, t1.RES_ID, t1.RES_MODEL, t1.STORE_FNAME, t1.TYPE, t1.URL FROM IR_ATTACHMENT t1
WHERE ( t1.RES_MODEL = #{srf.webcontext.res_model} AND t1.RES_ID = #{srf.webcontext.res_id} )
]]>
</sql>
<!--数据查询[Default]-->
<sql id="Default" databaseId="postgresql">
<![CDATA[ SELECT t1.ACCESS_TOKEN, t1.CHECKSUM, t1.COMPANY_ID, t1.FILE_SIZE, t1.ID, t1.KEY, t1.MIMETYPE, t1.NAME, t1.PUBLIC, t1.RES_FIELD, t1.RES_ID, t1.RES_MODEL, t1.STORE_FNAME, t1.TYPE, t1.URL FROM IR_ATTACHMENT t1
......
......@@ -135,6 +135,28 @@ public class Ir_attachmentResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Ir_attachment-searchByRes-all')")
@ApiOperation(value = "获取ByRes", tags = {"附件" } ,notes = "获取ByRes")
@RequestMapping(method= RequestMethod.GET , value="/ir_attachments/fetchbyres")
public ResponseEntity<List<Ir_attachmentDTO>> fetchByRes(Ir_attachmentSearchContext context) {
Page<Ir_attachment> domains = ir_attachmentService.searchByRes(context) ;
List<Ir_attachmentDTO> list = ir_attachmentMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Ir_attachment-searchByRes-all')")
@ApiOperation(value = "查询ByRes", tags = {"附件" } ,notes = "查询ByRes")
@RequestMapping(method= RequestMethod.POST , value="/ir_attachments/searchbyres")
public ResponseEntity<Page<Ir_attachmentDTO>> searchByRes(@RequestBody Ir_attachmentSearchContext context) {
Page<Ir_attachment> domains = ir_attachmentService.searchByRes(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(ir_attachmentMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Ir_attachment-searchDefault-all')")
@ApiOperation(value = "获取数据集", tags = {"附件" } ,notes = "获取数据集")
@RequestMapping(method= RequestMethod.GET , value="/ir_attachments/fetchdefault")
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册