| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.lf.server.mapper.data.MetaMapper"> |
| | | <mapper namespace="com.terra.system.mapper.data.MetaMapper"> |
| | | <select id="selectCount" resultType="java.lang.Integer"> |
| | | select count(*) from lf.sys_meta |
| | | <where> |
| | |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectByPage" resultType="com.lf.server.entity.data.MetaEntity"> |
| | | <select id="selectByPage" resultType="com.terra.system.entity.data.MetaEntity"> |
| | | select a.*,fn_uname(a.create_user) uname,fn_get_fullname(a.depcode, 1) depName,fn_ver(a.verid) verName,fn_get_fullname(a.dircode, 2) dirName |
| | | from lf.sys_meta a |
| | | <where> |
| | |
| | | limit #{limit} offset #{offset} |
| | | </select> |
| | | |
| | | <select id="selectGdbByGuid" resultType="com.lf.server.entity.data.MetaEntity"> |
| | | <select id="selectGdbByGuid" resultType="com.terra.system.entity.data.MetaEntity"> |
| | | select a.*,fn_uname(a.create_user) uname,fn_get_fullname(a.depcode, 1) depName,fn_ver(a.verid) verName,fn_get_fullname(a.dircode, 2) dirName |
| | | from lf.sys_meta a |
| | | where type = 'gdb' and guid = #{guid}; |
| | |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectMetasForPage" resultType="com.lf.server.entity.data.MetaEntity"> |
| | | <select id="selectMetasForPage" resultType="com.terra.system.entity.data.MetaEntity"> |
| | | select a.*,fn_uname(a.create_user) uname,fn_get_fullname(a.depcode, 1) depName,fn_ver(a.verid) verName,fn_get_fullname(a.dircode, 2) dirName, |
| | | (select coalesce(sum(dcount), 0) from lf.sys_download b inner join lf.sys_meta_down c on b.id = c.downid where c.metaid = a.id) "downCount", |
| | | (select fn_uname(download_user) from lf.sys_download b inner join lf.sys_meta_down c on b.id = c.downid where c.metaid = a.id order by download_time desc limit 1) "lastUser", |
| | |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectByPageForUpload" resultType="com.lf.server.entity.data.MetaEntity"> |
| | | <select id="selectByPageForUpload" resultType="com.terra.system.entity.data.MetaEntity"> |
| | | select a.*,fn_uname(a.create_user) uname,fn_get_fullname(a.depcode, 1) depName,fn_ver(a.verid) verName,fn_get_fullname(a.dircode, 2) dirName |
| | | from lf.sys_meta a |
| | | <where> |
| | |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectPageByPid" resultType="com.lf.server.entity.data.MetaEntity"> |
| | | <select id="selectPageByPid" resultType="com.terra.system.entity.data.MetaEntity"> |
| | | select a.*,fn_uname(a.create_user) uname,fn_get_fullname(a.depcode, 1) depName,fn_ver(a.verid) verName,fn_get_fullname(a.dircode, 2) dirName |
| | | from lf.sys_meta a |
| | | <where> |
| | |
| | | limit #{limit} offset #{offset} |
| | | </select> |
| | | |
| | | <select id="selectById" resultType="com.lf.server.entity.data.MetaEntity"> |
| | | <select id="selectById" resultType="com.terra.system.entity.data.MetaEntity"> |
| | | select a.*,fn_uname(a.create_user) uname,fn_get_fullname(a.depcode, 1) depName,fn_ver(a.verid) verName,fn_get_fullname(a.dircode, 2) dirName |
| | | from lf.sys_meta a where id = #{id} |
| | | </select> |
| | | |
| | | <select id="selectByGuid" resultType="com.lf.server.entity.data.MetaEntity"> |
| | | <select id="selectByGuid" resultType="com.terra.system.entity.data.MetaEntity"> |
| | | select a.*,fn_uname(a.create_user) uname,fn_get_fullname(a.depcode, 1) depName,fn_ver(a.verid) verName,fn_get_fullname(a.dircode, 2) dirName |
| | | from lf.sys_meta a |
| | | where guid = #{guid} |
| | |
| | | limit 1 |
| | | </select> |
| | | |
| | | <select id="selectByIdsForTab" resultType="com.lf.server.entity.data.MetaEntity"> |
| | | <select id="selectByIdsForTab" resultType="com.terra.system.entity.data.MetaEntity"> |
| | | select a.* from lf.sys_meta a |
| | | where id in (${ids}) and a.tab is not null and a.rows > 0 |
| | | order by a.tab; |
| | | </select> |
| | | |
| | | <select id="selectByIds" resultType="com.lf.server.entity.data.MetaEntity"> |
| | | <select id="selectByIds" resultType="com.terra.system.entity.data.MetaEntity"> |
| | | select a.* from lf.sys_meta a |
| | | where id in (${ids}) |
| | | order by id desc; |
| | | </select> |
| | | |
| | | <select id="selectMetaFiles" resultType="com.lf.server.entity.data.MetaEntity"> |
| | | <select id="selectMetaFiles" resultType="com.terra.system.entity.data.MetaEntity"> |
| | | select a.*,fn_uname(a.create_user) uname,fn_get_fullname(a.depcode, 1) depName,fn_ver(a.verid) verName,fn_get_fullname(a.dircode, 2) dirName |
| | | from lf.sys_meta a |
| | | where id in |
| | |
| | | order by a.id desc |
| | | </select> |
| | | |
| | | <select id="selectXlsAnnex" resultType="com.lf.server.entity.data.MetaEntity"> |
| | | <select id="selectXlsAnnex" resultType="com.terra.system.entity.data.MetaEntity"> |
| | | select * from lf.sys_meta |
| | | where type in ('xls', 'xlsx') and eventid is not null and tab is not null and rows > 0 and id in |
| | | <foreach item="id" collection="ids" index="index" open="(" separator="," close=")"> |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="selectMetasByDirCode" resultType="com.lf.server.entity.data.MetaEntity"> |
| | | <select id="selectMetasByDirCode" resultType="com.terra.system.entity.data.MetaEntity"> |
| | | select a.*, fn_uname(a.create_user) uname, fn_get_fullname(a.depcode, 1) depName, fn_ver(a.verid) verName, fn_get_fullname(a.dircode, 2) dirName |
| | | from lf.sys_meta a |
| | | where dircode like #{dircode} and |
| | |
| | | select a.count + b.count "count" from a, b; |
| | | </select> |
| | | |
| | | <insert id="insert" parameterType="com.lf.server.entity.data.MetaEntity"> |
| | | <insert id="insert" parameterType="com.terra.system.entity.data.MetaEntity"> |
| | | <selectKey resultType="java.lang.Integer" order="AFTER" keyProperty="id"> |
| | | select currval('lf.sys_meta_id_seq'::regclass) as id |
| | | </selectKey> |