| | |
| | | select count(*) from lf.sys_attach |
| | | <where> |
| | | <if test="name != null"> |
| | | name like #{name} |
| | | upper(name) like #{name} |
| | | </if> |
| | | </where> |
| | | </select> |
| | |
| | | select * from lf.sys_attach |
| | | <where> |
| | | <if test="name != null"> |
| | | name like #{name} |
| | | upper(name) like #{name} |
| | | </if> |
| | | </where> |
| | | order by id |
| | | order by id desc |
| | | limit #{limit} offset #{offset} |
| | | </select> |
| | | |
| | | <select id="selectAll" resultType="com.lf.server.entity.sys.AttachEntity"> |
| | | select * from lf.sys_attach order by id; |
| | | select * from lf.sys_attach order by id desc; |
| | | </select> |
| | | |
| | | <select id="selectById" resultType="com.lf.server.entity.sys.AttachEntity"> |
| | |
| | | |
| | | <select id="selectByTabAndGuid" resultType="com.lf.server.entity.sys.AttachEntity"> |
| | | select * from lf.sys_attach where tab = #{tab} and tab_guid = #{tabGuid} and guid = #{guid} limit 1 |
| | | </select> |
| | | |
| | | <select id="selectByTabGuids" resultType="com.lf.server.entity.sys.AttachEntity"> |
| | | select * from lf.sys_attach |
| | | <where> |
| | | tab = #{tab} |
| | | <if test="guids != null"> |
| | | and tab_guid in |
| | | <foreach item="guid" collection="guids" index="index" open="(" separator="," close=")"> |
| | | #{guid} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectByTab" resultType="com.lf.server.entity.sys.AttachEntity"> |
| | |
| | | where id = #{item.id} |
| | | </foreach> |
| | | </update> |
| | | |
| | | <!-- where count > 0 and update_time is null and create_time > now()::timestamp + '-5 min' and position(tcdm in '${tabs}') > 0; --> |
| | | <select id="selectFmeLogs" resultType="com.lf.server.entity.data.FmeLogEntity"> |
| | | select * from lf.sys_fme_log |
| | | where count > 0 and update_time is null and position(tcdm in '${tabs}') > 0; |
| | | </select> |
| | | |
| | | <update id="updateFmeLog"> |
| | | update lf.sys_fme_log set update_time = now() where id = #{id}; |
| | | </update> |
| | | |
| | | <!-- and create_time > now()::timestamp + '-15 min' --> |
| | | <insert id="insertAttachByMeta"> |
| | | 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} |
| | | <if test="dirid != null"> |
| | | and dircode like #{dirid} |
| | | </if> |
| | | </where> |
| | | order by id desc |
| | | limit 1; |
| | | </insert> |
| | | </mapper> |