|
@@ -6,6 +6,7 @@
|
|
|
|
|
|
<resultMap type="com.bosshand.virgo.api.model.Tag" id="tagResult">
|
|
|
<id column="id" property="id"/>
|
|
|
+ <result column="code" property="code"/>
|
|
|
<result column="name" property="name"/>
|
|
|
<result column="type" property="type"/>
|
|
|
<result column="organizationId" property="organizationId"/>
|
|
@@ -16,11 +17,15 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="getType" resultMap="tagResult">
|
|
|
- select * from tag where type = #{type}
|
|
|
+ select * from tag where type = #{type} or type = 0
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getCode" resultMap="tagResult">
|
|
|
+ select * from tag where code = #{code} or type = 0
|
|
|
</select>
|
|
|
|
|
|
<select id="getOrganizationId" resultMap="tagResult">
|
|
|
- select * from tag where organizationId = #{organizationId} and type = #{type}
|
|
|
+ select * from tag where organizationId = #{organizationId} and type = #{type} or type = 0
|
|
|
</select>
|
|
|
|
|
|
<select id="getList" resultMap="tagResult">
|
|
@@ -29,10 +34,13 @@
|
|
|
<if test="id != 0">
|
|
|
and id = #{id}
|
|
|
</if>
|
|
|
+ <if test="code != null">
|
|
|
+ and code = #{code}
|
|
|
+ </if>
|
|
|
<if test="name != null">
|
|
|
and name = #{name}
|
|
|
</if>
|
|
|
- <if test="type != 0">
|
|
|
+ <if test="type != -1">
|
|
|
and type = #{type}
|
|
|
</if>
|
|
|
<if test="organizationId != 0">
|
|
@@ -53,7 +61,7 @@
|
|
|
UPDATE tag
|
|
|
<trim prefix="set" suffixOverrides=",">
|
|
|
<if test="name!=null">name=#{name},</if>
|
|
|
- <if test="type!=0">type=#{type},</if>
|
|
|
+ <if test="type!=-1">type=#{type},</if>
|
|
|
<if test="organizationId!=0">organizationId=#{organizationId},</if>
|
|
|
</trim>
|
|
|
WHERE id=#{id}
|