|
@@ -8,6 +8,7 @@
|
|
|
<id column="id" property="id"/>
|
|
|
<result column="name" property="name"/>
|
|
|
<result column="type" property="type"/>
|
|
|
+ <result column="organizationId" property="organizationId"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<select id="get" resultMap="tagResult">
|
|
@@ -18,6 +19,10 @@
|
|
|
select * from tag where type = #{type}
|
|
|
</select>
|
|
|
|
|
|
+ <select id="getOrganizationId" resultMap="tagResult">
|
|
|
+ select * from tag where organizationId = #{organizationId} and type = #{type}
|
|
|
+ </select>
|
|
|
+
|
|
|
<select id="getList" resultMap="tagResult">
|
|
|
select * from tag
|
|
|
<where>
|
|
@@ -30,11 +35,14 @@
|
|
|
<if test="type != 0">
|
|
|
and type = #{type}
|
|
|
</if>
|
|
|
+ <if test="organizationId != 0">
|
|
|
+ and organizationId = #{organizationId}
|
|
|
+ </if>
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
|
<insert id="insert" useGeneratedKeys="true" keyProperty="id">
|
|
|
- INSERT INTO tag (name, type) VALUES (#{name}, #{type})
|
|
|
+ INSERT INTO tag (name, type, organizationId) VALUES (#{name}, #{type}, #{organizationId})
|
|
|
</insert>
|
|
|
|
|
|
<delete id="delete">
|
|
@@ -46,6 +54,7 @@
|
|
|
<trim prefix="set" suffixOverrides=",">
|
|
|
<if test="name!=null">name=#{name},</if>
|
|
|
<if test="type!=0">type=#{type},</if>
|
|
|
+ <if test="organizationId!=0">organizationId=#{organizationId},</if>
|
|
|
</trim>
|
|
|
WHERE id=#{id}
|
|
|
</update>
|