| | |
| | | select * from lf.sys_meta where id in (1393,1392,1383,1382) |
| | | -- tabs=元数据表,entities=sysmeta,gids=1393,1392,1383,1382 |
| | | |
| | | select * from lf.sys_layer order by id desc; |
| | | select * from bs.s_explorationpoint order by gid desc; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | package com.lf.server.mapper.sys; |
| | | |
| | | import com.lf.server.entity.data.FmeLogEntity; |
| | | import com.lf.server.entity.data.MetaEntity; |
| | | import com.lf.server.entity.sys.AttachEntity; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | |
| | | /** |
| | | * 根据元数据名称插入附件 |
| | | * |
| | | * @param metaName |
| | | * @param tab |
| | | * @param tabGuid |
| | | * @param metaName |
| | | * @param dirid |
| | | * @return |
| | | */ |
| | | public Integer insertAttachByMeta(String metaName, String tab, String tabGuid); |
| | | public Integer insertAttachByMeta(String tab, String tabGuid, String metaName, String dirid); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Integer insertAttachByMeta(String metaName, String tab, String tabGuid) { |
| | | return attachMapper.insertAttachByMeta(metaName, tab, tabGuid); |
| | | public Integer insertAttachByMeta(String tab, String tabGuid, String metaName, String dirid) { |
| | | return attachMapper.insertAttachByMeta(tab, tabGuid, metaName, dirid); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | BaseEntity be = (BaseEntity) obj; |
| | | String dirid = getDirid(be); |
| | | for (String name : names) { |
| | | insertAttachByMeta(name, tab, be.getEventid()); |
| | | insertAttachByMeta(tab, be.getEventid(), name, dirid); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取目录编码 |
| | | */ |
| | | private String getDirid(BaseEntity be) { |
| | | if (StringHelper.isEmpty(be.getDirid())) { |
| | | return null; |
| | | } |
| | | |
| | | String dirid = be.getDirid().substring(0, 2); |
| | | |
| | | return StringHelper.getRightLike(dirid); |
| | | } |
| | | |
| | | /** |
| | | * 根据父ID查询记录 |
| | | */ |
| | | private List<?> selectRowsByParentid(String entity, String parentid, String field) { |
| | |
| | | insert into lf.sys_attach (name, guid, path, sizes, create_user, tab, tab_guid) |
| | | select name, guid, path, sizes, create_user, #{tab}, #{tabGuid} |
| | | from lf.sys_meta |
| | | where name = #{metaName} |
| | | <where> |
| | | name = #{metaName} |
| | | <if test="dirid != null"> |
| | | and dirid like #{dirid} |
| | | </if> |
| | | </where> |
| | | order by id desc |
| | | limit 1; |
| | | </insert> |