123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- <?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="cn.ubitech.ttc.dao.NodeMapper">
- <!-- 开启二级缓存 -->
- <cache type="org.mybatis.caches.ehcache.EhcacheCache">
- <property name="timeToIdleSeconds" value="1200"/>
- <property name="timeToLiveSeconds" value="1800"/>
- <property name="maxEntriesLocalHeap" value="1000"/>
- <property name="maxEntriesLocalDisk" value="10000000"/>
- <property name="memoryStoreEvictionPolicy" value="LRU"/>
- </cache>
- <select id="getByKeyword" resultType="cn.ubitech.ttc.entity.Node">
- SELECT
- n.*,
- CASE WHEN un.id IS NULL THEN 0 ELSE 1 END isusersnode,
- IFNULL(un.id, 0) lkid
- FROM node n
- LEFT JOIN sys_users_nodes un
- ON n.id = un.node
- AND un.userId = #{userid}
- AND un.IsEnabled = 1
- WHERE name LIKE #{keyword}
- AND issearch = 1
- </select>
- <select id="getAllNode" resultType="cn.ubitech.ttc.entity.Node">
- SELECT n.*, IFNULL(oi.orgtype,0) orgtype FROM node n LEFT JOIN organization_info oi on n.orgid = oi.id
- </select>
- <insert id="insertHasId" parameterType="cn.ubitech.ttc.entity.Node">
- insert into node ( id ,regionid ,orgid,ipaddress,name <include refid="getField" /> )
- values (#{id} ,#{regionid} ,#{orgid},#{ipaddress},#{name} <include refid="fieldValue" /> )
- </insert>
- <sql id="getField">
- <trim prefix="," suffixOverrides=",">
- <if test="messageport !=null">
- messageport,
- </if>
- <if test="domain !=null">
- domain,
- </if>
- <if test="province !=null">
- province,
- </if>
- <if test="district !=null">
- district,
- </if>
- <if test="city !=null">
- city,
- </if>
- <if test="street !=null">
- street,
- </if>
- <if test="remark !=null">
- remark,
- </if>
- <if test="version !=null">
- version,
- </if>
- <if test="logo !=null">
- logo,
- </if>
- <if test="issearch !=null">
- issearch
- </if>
- </trim>
- </sql>
- <sql id="fieldValue">
- <trim prefix="," suffixOverrides=",">
- <if test="messageport !=null">
- #{messageport},
- </if>
- <if test="domain !=null">
- #{domain},
- </if>
- <if test="province !=null">
- #{province},
- </if>
- <if test="district !=null">
- #{district},
- </if>
- <if test="city !=null">
- #{city},
- </if>
- <if test="street !=null">
- #{street},
- </if>
- <if test="remark !=null">
- #{remark},
- </if>
- <if test="version !=null">
- #{version},
- </if>
- <if test="logo !=null">
- #{logo},
- </if>
- <if test="issearch !=null">
- #{issearch}
- </if>
- </trim>
- </sql>
- </mapper>
|