|
@@ -0,0 +1,373 @@
|
|
|
|
+<?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.steerinfo.ems.emssecuernode.mapper.EmsSecuerNodeMapper">
|
|
|
|
+ <resultMap id="BaseResultMap" type="com.steerinfo.ems.emssecuernode.model.EmsSecuerNode">
|
|
|
|
+ <id column="ID" jdbcType="VARCHAR" property="id" />
|
|
|
|
+ <result column="USERNAME" jdbcType="VARCHAR" property="username" />
|
|
|
|
+ <result column="ITEMSTATUS" jdbcType="DECIMAL" property="itemstatus" />
|
|
|
|
+ <result column="ITEMTYPE" jdbcType="DECIMAL" property="itemtype" />
|
|
|
|
+ <result column="PARENTID" jdbcType="VARCHAR" property="parentid" />
|
|
|
|
+ <result column="NAME" jdbcType="VARCHAR" property="name" />
|
|
|
|
+ <result column="EMPLOYEESTOTAL" jdbcType="DECIMAL" property="employeestotal" />
|
|
|
|
+ <result column="CREATETIME" jdbcType="VARCHAR" property="createtime" />
|
|
|
|
+ <result column="UPDATETIME" jdbcType="VARCHAR" property="updatetime" />
|
|
|
|
+ <result column="CONTENT" jdbcType="VARCHAR" property="content" />
|
|
|
|
+ <result column="TLEVEL" jdbcType="DECIMAL" property="tlevel" />
|
|
|
|
+ <result column="FILE_NAME" jdbcType="VARCHAR" property="file_name" />
|
|
|
|
+ <result column="FILE_URL" jdbcType="VARCHAR" property="file_url" />
|
|
|
|
+ </resultMap>
|
|
|
|
+ <sql id="columns">
|
|
|
|
+ ID, USERNAME, ITEMSTATUS, ITEMTYPE, PARENTID, NAME, EMPLOYEESTOTAL, CREATETIME, UPDATETIME,
|
|
|
|
+ CONTENT, TLEVEL
|
|
|
|
+ </sql>
|
|
|
|
+ <sql id="columns_alias">
|
|
|
|
+ t.ID, t.USERNAME, t.ITEMSTATUS, t.ITEMTYPE, t.PARENTID, t.NAME, t.EMPLOYEESTOTAL,
|
|
|
|
+ t.CREATETIME, t.UPDATETIME, t.CONTENT, t.TLEVEL
|
|
|
|
+ </sql>
|
|
|
|
+ <sql id="select">
|
|
|
|
+ SELECT <include refid="columns"/> FROM EMS_SECUER_NODE
|
|
|
|
+ </sql>
|
|
|
|
+ <sql id="select_alias">
|
|
|
|
+ SELECT <include refid="columns_alias"/> FROM EMS_SECUER_NODE t
|
|
|
|
+ </sql>
|
|
|
|
+ <sql id="where">
|
|
|
|
+ <where>
|
|
|
|
+ <if test="id != null and id != ''">
|
|
|
|
+ and ID = #{id}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="username != null and username != ''">
|
|
|
|
+ and USERNAME = #{username}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="itemstatus != null">
|
|
|
|
+ and ITEMSTATUS = #{itemstatus}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="itemtype != null">
|
|
|
|
+ and ITEMTYPE = #{itemtype}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="parentid != null and parentid != ''">
|
|
|
|
+ and PARENTID = #{parentid}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="name != null and name != ''">
|
|
|
|
+ and NAME = #{name}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="employeestotal != null">
|
|
|
|
+ and EMPLOYEESTOTAL = #{employeestotal}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="createtime != null and createtime != ''">
|
|
|
|
+ and CREATETIME = #{createtime}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="updatetime != null and updatetime != ''">
|
|
|
|
+ and UPDATETIME = #{updatetime}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="content != null and content != ''">
|
|
|
|
+ and CONTENT = #{content}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="tlevel != null">
|
|
|
|
+ and TLEVEL = #{tlevel}
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ </sql>
|
|
|
|
+ <sql id="whereLike">
|
|
|
|
+ <where>
|
|
|
|
+ <if test="id != null and id != ''">
|
|
|
|
+ and ID LIKE '%${id}%'
|
|
|
|
+ </if>
|
|
|
|
+ <if test="username != null and username != ''">
|
|
|
|
+ and USERNAME LIKE '%${username}%'
|
|
|
|
+ </if>
|
|
|
|
+ <if test="itemstatus != null">
|
|
|
|
+ and ITEMSTATUS = #{itemstatus}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="itemtype != null">
|
|
|
|
+ and ITEMTYPE = #{itemtype}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="parentid != null and parentid != ''">
|
|
|
|
+ and PARENTID LIKE '%${parentid}%'
|
|
|
|
+ </if>
|
|
|
|
+ <if test="name != null and name != ''">
|
|
|
|
+ and NAME LIKE '%${name}%'
|
|
|
|
+ </if>
|
|
|
|
+ <if test="employeestotal != null">
|
|
|
|
+ and EMPLOYEESTOTAL = #{employeestotal}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="createtime != null and createtime != ''">
|
|
|
|
+ and CREATETIME LIKE '%${createtime}%'
|
|
|
|
+ </if>
|
|
|
|
+ <if test="updatetime != null and updatetime != ''">
|
|
|
|
+ and UPDATETIME LIKE '%${updatetime}%'
|
|
|
|
+ </if>
|
|
|
|
+ <if test="content != null and content != ''">
|
|
|
|
+ and CONTENT LIKE '%${content}%'
|
|
|
|
+ </if>
|
|
|
|
+ <if test="tlevel != null">
|
|
|
|
+ and TLEVEL = #{tlevel}
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ </sql>
|
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
|
|
|
+ delete from EMS_SECUER_NODE
|
|
|
|
+ where ID = #{id,jdbcType=VARCHAR}
|
|
|
|
+ </delete>
|
|
|
|
+ <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
|
|
|
|
+ delete from EMS_SECUER_NODE
|
|
|
|
+ where 1!=1
|
|
|
|
+ <if test="username != null and username != ''">
|
|
|
|
+ or USERNAME = #{username}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="itemstatus != null">
|
|
|
|
+ or ITEMSTATUS = #{itemstatus}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="itemtype != null">
|
|
|
|
+ or ITEMTYPE = #{itemtype}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="parentid != null and parentid != ''">
|
|
|
|
+ or PARENTID = #{parentid}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="name != null and name != ''">
|
|
|
|
+ or NAME = #{name}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="employeestotal != null">
|
|
|
|
+ or EMPLOYEESTOTAL = #{employeestotal}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="createtime != null and createtime != ''">
|
|
|
|
+ or CREATETIME = #{createtime}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="updatetime != null and updatetime != ''">
|
|
|
|
+ or UPDATETIME = #{updatetime}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="content != null and content != ''">
|
|
|
|
+ or CONTENT = #{content}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="tlevel != null">
|
|
|
|
+ or TLEVEL = #{tlevel}
|
|
|
|
+ </if>
|
|
|
|
+ </delete>
|
|
|
|
+ <insert id="insert" parameterType="com.steerinfo.ems.emssecuernode.model.EmsSecuerNode">
|
|
|
|
+ insert into EMS_SECUER_NODE (ID, USERNAME, ITEMSTATUS,
|
|
|
|
+ ITEMTYPE, PARENTID, NAME,
|
|
|
|
+ EMPLOYEESTOTAL, CREATETIME, UPDATETIME,
|
|
|
|
+ CONTENT, TLEVEL)
|
|
|
|
+ values (#{id,jdbcType=VARCHAR}, #{username,jdbcType=VARCHAR}, #{itemstatus,jdbcType=DECIMAL},
|
|
|
|
+ #{itemtype,jdbcType=DECIMAL}, #{parentid,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
|
|
|
|
+ #{employeestotal,jdbcType=DECIMAL}, #{createtime,jdbcType=VARCHAR}, #{updatetime,jdbcType=VARCHAR},
|
|
|
|
+ #{content,jdbcType=VARCHAR}, #{tlevel,jdbcType=DECIMAL})
|
|
|
|
+ </insert>
|
|
|
|
+ <insert id="insertSelective" parameterType="com.steerinfo.ems.emssecuernode.model.EmsSecuerNode">
|
|
|
|
+ insert into EMS_SECUER_NODE
|
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="id != null">
|
|
|
|
+ ID,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="username != null">
|
|
|
|
+ USERNAME,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="itemstatus != null">
|
|
|
|
+ ITEMSTATUS,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="itemtype != null">
|
|
|
|
+ ITEMTYPE,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="parentid != null">
|
|
|
|
+ PARENTID,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="name != null">
|
|
|
|
+ NAME,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="employeestotal != null">
|
|
|
|
+ EMPLOYEESTOTAL,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="createtime != null">
|
|
|
|
+ CREATETIME,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="updatetime != null">
|
|
|
|
+ UPDATETIME,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="content != null">
|
|
|
|
+ CONTENT,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="tlevel != null">
|
|
|
|
+ TLEVEL,
|
|
|
|
+ </if>
|
|
|
|
+ </trim>
|
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="id != null">
|
|
|
|
+ #{id,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="username != null">
|
|
|
|
+ #{username,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="itemstatus != null">
|
|
|
|
+ #{itemstatus,jdbcType=DECIMAL},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="itemtype != null">
|
|
|
|
+ #{itemtype,jdbcType=DECIMAL},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="parentid != null">
|
|
|
|
+ #{parentid,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="name != null">
|
|
|
|
+ #{name,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="employeestotal != null">
|
|
|
|
+ #{employeestotal,jdbcType=DECIMAL},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="createtime != null">
|
|
|
|
+ #{createtime,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="updatetime != null">
|
|
|
|
+ #{updatetime,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="content != null">
|
|
|
|
+ #{content,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="tlevel != null">
|
|
|
|
+ #{tlevel,jdbcType=DECIMAL},
|
|
|
|
+ </if>
|
|
|
|
+ </trim>
|
|
|
|
+ </insert>
|
|
|
|
+ <update id="updateByPrimaryKey" parameterType="com.steerinfo.ems.emssecuernode.model.EmsSecuerNode">
|
|
|
|
+ update EMS_SECUER_NODE
|
|
|
|
+ set USERNAME = #{username,jdbcType=VARCHAR},
|
|
|
|
+ ITEMSTATUS = #{itemstatus,jdbcType=DECIMAL},
|
|
|
|
+ ITEMTYPE = #{itemtype,jdbcType=DECIMAL},
|
|
|
|
+ PARENTID = #{parentid,jdbcType=VARCHAR},
|
|
|
|
+ NAME = #{name,jdbcType=VARCHAR},
|
|
|
|
+ EMPLOYEESTOTAL = #{employeestotal,jdbcType=DECIMAL},
|
|
|
|
+ CREATETIME = #{createtime,jdbcType=VARCHAR},
|
|
|
|
+ UPDATETIME = #{updatetime,jdbcType=VARCHAR},
|
|
|
|
+ CONTENT = #{content,jdbcType=VARCHAR},
|
|
|
|
+ TLEVEL = #{tlevel,jdbcType=DECIMAL}
|
|
|
|
+ where ID = #{id,jdbcType=VARCHAR}
|
|
|
|
+ </update>
|
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.ems.emssecuernode.model.EmsSecuerNode">
|
|
|
|
+ update EMS_SECUER_NODE
|
|
|
|
+ <set>
|
|
|
|
+ <if test="username != null">
|
|
|
|
+ USERNAME = #{username,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="itemstatus != null">
|
|
|
|
+ ITEMSTATUS = #{itemstatus,jdbcType=DECIMAL},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="itemtype != null">
|
|
|
|
+ ITEMTYPE = #{itemtype,jdbcType=DECIMAL},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="parentid != null">
|
|
|
|
+ PARENTID = #{parentid,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="name != null">
|
|
|
|
+ NAME = #{name,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="employeestotal != null">
|
|
|
|
+ EMPLOYEESTOTAL = #{employeestotal,jdbcType=DECIMAL},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="createtime != null">
|
|
|
|
+ CREATETIME = #{createtime,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="updatetime != null">
|
|
|
|
+ UPDATETIME = #{updatetime,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="content != null">
|
|
|
|
+ CONTENT = #{content,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="tlevel != null">
|
|
|
|
+ TLEVEL = #{tlevel,jdbcType=DECIMAL},
|
|
|
|
+ </if>
|
|
|
|
+ </set>
|
|
|
|
+ where ID = #{id,jdbcType=VARCHAR}
|
|
|
|
+ </update>
|
|
|
|
+ <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
|
|
|
|
+ <include refid="select"/>
|
|
|
|
+ where ID = #{id,jdbcType=VARCHAR}
|
|
|
|
+ </select>
|
|
|
|
+ <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
|
|
|
|
+ <include refid="select"/>
|
|
|
|
+ <include refid="where"/>
|
|
|
|
+ </select>
|
|
|
|
+ <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
|
|
|
|
+ <include refid="select"/>
|
|
|
|
+ <include refid="whereLike"/>
|
|
|
|
+ </select>
|
|
|
|
+ <insert id="batchInsert" parameterType="java.util.List">
|
|
|
|
+ insert into EMS_SECUER_NODE
|
|
|
|
+ (ID,
|
|
|
|
+ USERNAME, ITEMSTATUS, ITEMTYPE,
|
|
|
|
+ PARENTID, NAME, EMPLOYEESTOTAL,
|
|
|
|
+ CREATETIME, UPDATETIME, CONTENT,
|
|
|
|
+ TLEVEL)
|
|
|
|
+ ( <foreach collection="list" item="item" separator="union all">
|
|
|
|
+ select
|
|
|
|
+ #{item.id,jdbcType=VARCHAR},
|
|
|
|
+ #{item.username,jdbcType=VARCHAR}, #{item.itemstatus,jdbcType=DECIMAL}, #{item.itemtype,jdbcType=DECIMAL},
|
|
|
|
+ #{item.parentid,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR}, #{item.employeestotal,jdbcType=DECIMAL},
|
|
|
|
+ #{item.createtime,jdbcType=VARCHAR}, #{item.updatetime,jdbcType=VARCHAR}, #{item.content,jdbcType=VARCHAR},
|
|
|
|
+ #{item.tlevel,jdbcType=DECIMAL} from dual
|
|
|
|
+ </foreach> )
|
|
|
|
+ </insert>
|
|
|
|
+ <update id="batchUpdate" parameterType="java.util.List">
|
|
|
|
+ update EMS_SECUER_NODE
|
|
|
|
+ set
|
|
|
|
+ ID=
|
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
|
|
|
|
+ when #{item.id,jdbcType=VARCHAR} then #{item.id,jdbcType=VARCHAR}
|
|
|
|
+ </foreach>
|
|
|
|
+ ,USERNAME=
|
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
|
|
|
|
+ when #{item.id,jdbcType=VARCHAR} then #{item.username,jdbcType=VARCHAR}
|
|
|
|
+ </foreach>
|
|
|
|
+ ,ITEMSTATUS=
|
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
|
|
|
|
+ when #{item.id,jdbcType=VARCHAR} then #{item.itemstatus,jdbcType=DECIMAL}
|
|
|
|
+ </foreach>
|
|
|
|
+ ,ITEMTYPE=
|
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
|
|
|
|
+ when #{item.id,jdbcType=VARCHAR} then #{item.itemtype,jdbcType=DECIMAL}
|
|
|
|
+ </foreach>
|
|
|
|
+ ,PARENTID=
|
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
|
|
|
|
+ when #{item.id,jdbcType=VARCHAR} then #{item.parentid,jdbcType=VARCHAR}
|
|
|
|
+ </foreach>
|
|
|
|
+ ,NAME=
|
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
|
|
|
|
+ when #{item.id,jdbcType=VARCHAR} then #{item.name,jdbcType=VARCHAR}
|
|
|
|
+ </foreach>
|
|
|
|
+ ,EMPLOYEESTOTAL=
|
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
|
|
|
|
+ when #{item.id,jdbcType=VARCHAR} then #{item.employeestotal,jdbcType=DECIMAL}
|
|
|
|
+ </foreach>
|
|
|
|
+ ,CREATETIME=
|
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
|
|
|
|
+ when #{item.id,jdbcType=VARCHAR} then #{item.createtime,jdbcType=VARCHAR}
|
|
|
|
+ </foreach>
|
|
|
|
+ ,UPDATETIME=
|
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
|
|
|
|
+ when #{item.id,jdbcType=VARCHAR} then #{item.updatetime,jdbcType=VARCHAR}
|
|
|
|
+ </foreach>
|
|
|
|
+ ,CONTENT=
|
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
|
|
|
|
+ when #{item.id,jdbcType=VARCHAR} then #{item.content,jdbcType=VARCHAR}
|
|
|
|
+ </foreach>
|
|
|
|
+ ,TLEVEL=
|
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
|
|
|
|
+ when #{item.id,jdbcType=VARCHAR} then #{item.tlevel,jdbcType=DECIMAL}
|
|
|
|
+ </foreach>
|
|
|
|
+ where ID in
|
|
|
|
+ <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
|
|
|
|
+ #{item.id,jdbcType=VARCHAR}
|
|
|
|
+ </foreach>
|
|
|
|
+ </update>
|
|
|
|
+ <delete id="batchDelete" parameterType="java.util.List">
|
|
|
|
+ delete from EMS_SECUER_NODE
|
|
|
|
+ where ID in
|
|
|
|
+ <foreach collection="list" item="id" open="(" close=")" separator=",">
|
|
|
|
+ #{id}
|
|
|
|
+ </foreach>
|
|
|
|
+ </delete>
|
|
|
|
+ <!-- 友情提示!!!-->
|
|
|
|
+ <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
|
|
|
|
+ <select id="findAll" resultMap="BaseResultMap">
|
|
|
|
+ select * from EMS_SECUER_NODE t left join UPLOAD_FILE t1 on t.id = t1.id
|
|
|
|
+ </select>
|
|
|
|
+ <select id="findnodeId" resultMap="BaseResultMap" parameterType="string">
|
|
|
|
+ select * from EMS_SECUER_NODE t left join UPLOAD_FILE t1 on t.id = t1.id where t.id = #{id,jdbcType=VARCHAR}
|
|
|
|
+ </select>
|
|
|
|
+</mapper>
|