| | |
| | | select gb,name,classes,pinyin,pac,bsm,geom,eventid,dirid,depid,verid,createtime,createuser,updateuser,updatetime from bd.dlg_agnp |
| | | |
| | | select * from bs.bs_project; |
| | | |
| | | select * from bd.dlg_agnp order by gid desc; |
| | | insert into bd.dlg_agnp(gb,name) values('01','A01'); |
| | | insert into bd.dlg_agnp(gb,name) values('02','A02'); |
| | | select * from lf.sys_dict where ns='bs' and tab='bs_project'; |
| | | |
| | | |
| | | |
| | | |
| | | select fn_rec_query(depid,'dep') depName,fn_rec_query(dirid,'dir') dirName,fn_ver(verid) verName, |
| | | fn_uname(createuser) createName,fn_uname(updateuser) updateName from bd.dlg_agnp limit 10; |
| | | |
| | | |
| | | |
| | |
| | | package com.lf.server.entity.all; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | |
| | | import java.io.Serializable; |
| | |
| | | private Integer updateuser; |
| | | |
| | | private Timestamp updatetime; |
| | | |
| | | @TableField(value = "fn_rec_query(dirid,'dir')") |
| | | private String dirName; |
| | | |
| | | @TableField(value = "fn_rec_query(depid,'dep')") |
| | | private String depName; |
| | | |
| | | @TableField(value = "fn_ver(verid)") |
| | | private String verName; |
| | | |
| | | @TableField(value = "fn_uname(createuser)") |
| | | private String createName; |
| | | |
| | | @TableField(value = "fn_uname(updateuser)") |
| | | private String updateName; |
| | | |
| | | public BaseEntity() { |
| | | } |
| | |
| | | public void setUpdatetime(Timestamp updatetime) { |
| | | this.updatetime = updatetime; |
| | | } |
| | | |
| | | public String getDirName() { |
| | | return dirName; |
| | | } |
| | | |
| | | public void setDirName(String dirName) { |
| | | this.dirName = dirName; |
| | | } |
| | | |
| | | public String getDepName() { |
| | | return depName; |
| | | } |
| | | |
| | | public void setDepName(String depName) { |
| | | this.depName = depName; |
| | | } |
| | | |
| | | public String getVerName() { |
| | | return verName; |
| | | } |
| | | |
| | | public void setVerName(String verName) { |
| | | this.verName = verName; |
| | | } |
| | | |
| | | public String getCreateName() { |
| | | return createName; |
| | | } |
| | | |
| | | public void setCreateName(String createName) { |
| | | this.createName = createName; |
| | | } |
| | | |
| | | public String getUpdateName() { |
| | | return updateName; |
| | | } |
| | | |
| | | public void setUpdateName(String updateName) { |
| | | this.updateName = updateName; |
| | | } |
| | | } |
| | |
| | | package com.lf.server.entity.all; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 静态数据类 |
| | | * @author WWW |
| | |
| | | * 字符点 |
| | | */ |
| | | public final static String POINT = "."; |
| | | |
| | | /** |
| | | * 插入排除字段 |
| | | */ |
| | | public final static List<String> INSERT_EXCLUDE_FIELDS = new ArrayList<>(Arrays.asList("gid", "objectid", "updateuser", "updatetime", "shape_leng", "shape_area", "dirName", "depName", "verName", "createName", "updateName")); |
| | | |
| | | /** |
| | | * 更新排除字段 |
| | | */ |
| | | public final static List<String> UPDATE_EXCLUDE_FIELDS = new ArrayList<>(Arrays.asList("objectid", "createuser", "createtime", "shape_leng", "shape_area", "dirName", "depName", "verName", "createName", "updateName")); |
| | | |
| | | /** |
| | | * 读取排除字段 |
| | | */ |
| | | public final static List<String> READ_EXCLUDE_FIELDS = new ArrayList<>(Arrays.asList("gid", "objectid", "dirid", "depid", "verid", "createtime", "createuser", "updateuser", "updatetime", "shape_leng", "shape_area", "dirName", "depName", "verName", "createName", "updateName")); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.injector.AbstractMethod; |
| | | import com.baomidou.mybatisplus.core.metadata.TableFieldInfo; |
| | | import com.baomidou.mybatisplus.core.metadata.TableInfo; |
| | | import com.lf.server.helper.GdbHelper; |
| | | import com.lf.server.entity.all.StaticData; |
| | | import org.apache.ibatis.executor.keygen.NoKeyGenerator; |
| | | import org.apache.ibatis.mapping.MappedStatement; |
| | | import org.apache.ibatis.mapping.SqlSource; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 批量插入方法 |
| | |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class InsertBatchMethod extends AbstractMethod { |
| | | private static List<String> excludeFields = new ArrayList<>(Arrays.asList("gid", "objectid", "updateuser", "updatetime", "shape_leng", "shape_area")); |
| | | |
| | | /** |
| | | * insert into user(id, name, age) values (1, "a", 17), (2, "b", 18); |
| | | * <script> |
| | |
| | | // fieldSql.append(tableInfo.getKeyColumn()).append(",") |
| | | // tableInfo.getFieldList().forEach(x -> fieldSql.append(x.getColumn()).append(",")) |
| | | for (TableFieldInfo f : tableInfo.getFieldList()) { |
| | | if (excludeFields.contains(f.getColumn())) { |
| | | if (StaticData.INSERT_EXCLUDE_FIELDS.contains(f.getColumn())) { |
| | | continue; |
| | | } |
| | | |
| | |
| | | // valueSql.append("#{item.").append(tableInfo.getKeyProperty()).append("},") |
| | | // tableInfo.getFieldList().forEach(x -> valueSql.append("#{item.").append(x.getProperty()).append("},")) |
| | | for (TableFieldInfo f : tableInfo.getFieldList()) { |
| | | if (excludeFields.contains(f.getColumn())) { |
| | | if (StaticData.INSERT_EXCLUDE_FIELDS.contains(f.getColumn())) { |
| | | continue; |
| | | } |
| | | |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.TableFieldInfo; |
| | | import com.baomidou.mybatisplus.core.metadata.TableInfo; |
| | | import com.baomidou.mybatisplus.core.toolkit.sql.SqlScriptUtils; |
| | | import com.lf.server.entity.all.StaticData; |
| | | import org.apache.ibatis.mapping.MappedStatement; |
| | | import org.apache.ibatis.mapping.SqlSource; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 批量更新方法 |
| | |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class UpdateBatchMethod extends AbstractMethod { |
| | | private static List<String> excludeFields = new ArrayList<>(Arrays.asList("objectid", "createuser", "createtime", "shape_leng", "shape_area")); |
| | | |
| | | /** |
| | | * update user set name = "a", age = 17 where id = 1; |
| | | * update user set name = "b", age = 18 where id = 2; |
| | |
| | | private String getSqlSet(TableInfo tableInfo) { |
| | | StringBuilder sb = new StringBuilder(); |
| | | for (TableFieldInfo f : tableInfo.getFieldList()) { |
| | | if (excludeFields.contains(f.getColumn())) { |
| | | if (StaticData.UPDATE_EXCLUDE_FIELDS.contains(f.getColumn())) { |
| | | continue; |
| | | } |
| | | |
| | |
| | | package com.lf.server.helper; |
| | | |
| | | import com.lf.server.entity.all.StaticData; |
| | | import org.apache.commons.logging.Log; |
| | | import org.apache.commons.logging.LogFactory; |
| | | import org.gdal.ogr.*; |
| | |
| | | private final static Log log = LogFactory.getLog(GdbHelper.class); |
| | | |
| | | private final static String OBJECT ="java.lang.Object"; |
| | | |
| | | private static List<String> excludeFields = new ArrayList<>(Arrays.asList("gid", "objectid", "dirid", "depid", "verid","createtime", "createuser", "updateuser", "updatetime", "shape_leng", "shape_area")); |
| | | |
| | | /** |
| | | * 销毁资源 |
| | |
| | | FieldDefn fieldDefn = fd.GetFieldDefn(i); |
| | | try { |
| | | String name = fieldDefn.GetName().toLowerCase(); |
| | | if (excludeFields.contains(name)) { |
| | | if (StaticData.READ_EXCLUDE_FIELDS.contains(name)) { |
| | | continue; |
| | | } |
| | | |