|
|
@@ -7,6 +7,7 @@
|
|
|
<resultMap type="com.dgtly.wxportal.domain.WxMagnet" id="WxMagnetResult">
|
|
|
<id property="magnetId" column="magnet_id" />
|
|
|
<result property="magnetName" column="magnet_name" />
|
|
|
+ <result property="userType" column="user_type" />
|
|
|
<result property="fatherMagnet" column="father_magnet" />
|
|
|
<result property="orderNum" column="order_num" />
|
|
|
<result property="url" column="url" />
|
|
|
@@ -25,18 +26,18 @@
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectMagnetVo">
|
|
|
- select magnet_id, magnet_name, father_magnet,order_num, url, visible, magnet_size, bg_url ,remark, magnet_type, applet_qr_url, create_by, create_time
|
|
|
+ select magnet_id, magnet_name, user_type,father_magnet,order_num, url, visible, magnet_size, bg_url ,remark, magnet_type, applet_qr_url, create_by, create_time
|
|
|
from wx_magnet
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectTileMagnetList" parameterType="com.dgtly.wxportal.domain.WxMagnet" resultMap="WxMagnetResult">
|
|
|
- select distinct m.magnet_id, m.father_magnet, m.magnet_name, m.url, m.visible, m.magnet_size
|
|
|
+ select distinct m.magnet_id, m.father_magnet, m.magnet_name,m.user_type, m.url, m.visible, m.magnet_size
|
|
|
, m.bg_url, m.order_num, m.create_time, m.magnet_type, m.applet_qr_url
|
|
|
from wx_magnet m where m.visible =0
|
|
|
</select>
|
|
|
|
|
|
<select id="selectMagnetList" parameterType="com.dgtly.wxportal.domain.WxMagnet" resultMap="WxMagnetResult">
|
|
|
- select distinct m.magnet_id, m.father_magnet, m.magnet_name, m.url, m.visible, m.magnet_size
|
|
|
+ select distinct m.magnet_id, m.father_magnet, m.magnet_name,m.user_type, m.url, m.visible, m.magnet_size
|
|
|
, m.bg_url, m.order_num, m.create_time, m.magnet_type, m.applet_qr_url
|
|
|
from wx_magnet m
|
|
|
<where>
|
|
|
@@ -49,6 +50,9 @@
|
|
|
<if test="magnetSize != null and magnetSize != ''">
|
|
|
AND m.magnet_size = #{magnetSize}
|
|
|
</if>
|
|
|
+ <if test="userType != null and userType != ''">
|
|
|
+ AND m.user_type = #{userType}
|
|
|
+ </if>
|
|
|
<if test="magnetType != null and magnetType != ''">
|
|
|
AND m.magnet_type = #{magnetType}
|
|
|
</if>
|
|
|
@@ -73,13 +77,14 @@
|
|
|
|
|
|
<select id="checkMagnetNameUnique" resultMap="WxMagnetResult">
|
|
|
<include refid="selectMagnetVo"/>
|
|
|
- where magnet_name=#{magnetName}
|
|
|
+ where magnet_name=#{magnetName} and user_type=#{userType}
|
|
|
</select>
|
|
|
|
|
|
<insert id="insertMagnet" parameterType="com.dgtly.wxportal.domain.WxMagnet">
|
|
|
insert into wx_magnet(
|
|
|
<if test="magnetId != null and magnetId != 0">magnet_id,</if>
|
|
|
<if test="magnetName != null and magnetName != ''">magnet_name,</if>
|
|
|
+ <if test="userType != null and userType != ''">user_type,</if>
|
|
|
<if test="fatherMagnet != null and fatherMagnet != ''">father_magnet,</if>
|
|
|
<if test="orderNum != null and orderNum != ''">order_num,</if>
|
|
|
<if test="url != null and url != ''">url,</if>
|
|
|
@@ -94,6 +99,7 @@
|
|
|
)values(
|
|
|
<if test="magnetId != null and magnetId != 0">#{magnetId},</if>
|
|
|
<if test="magnetName != null and magnetName != ''">#{magnetName},</if>
|
|
|
+ <if test="userType != null and userType != ''">#{userType},</if>
|
|
|
<if test="fatherMagnet != null and fatherMagnet != ''">#{fatherMagnet},</if>
|
|
|
<if test="orderNum != null and orderNum != ''">#{orderNum},</if>
|
|
|
<if test="url != null and url != ''">#{url},</if>
|
|
|
@@ -112,6 +118,7 @@
|
|
|
update wx_magnet
|
|
|
<set>
|
|
|
<if test="magnetName != null and magnetName != ''">magnet_name = #{magnetName},</if>
|
|
|
+ <if test="userType != null and userType != ''">user_type = #{userType},</if>
|
|
|
<if test="fatherMagnet != null and fatherMagnet != ''">father_magnet =#{fatherMagnet},</if>
|
|
|
<if test="orderNum != null and orderNum != ''">order_num = #{orderNum},</if>
|
|
|
<if test="url != null and url != ''">url = #{url},</if>
|
|
|
@@ -133,7 +140,7 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="selectMagnetAllByUserId" resultMap="WxMagnetResult">
|
|
|
- select distinct m.magnet_id, m.magnet_name,m.father_magnet, m.url, m.visible, m.magnet_size
|
|
|
+ select distinct m.magnet_id, m.magnet_name,m.user_type,m.father_magnet, m.url, m.visible, m.magnet_size
|
|
|
, m.bg_url, m.order_num, m.create_time, m.magnet_type, m.applet_qr_url
|
|
|
from wx_magnet m
|
|
|
left join wx_role_magnet rm on m.magnet_id = rm.magnet_id
|
|
|
@@ -144,6 +151,9 @@
|
|
|
<if test="wxMagnet.magnetName != null and wxMagnet.magnetName != ''">
|
|
|
AND m.magnet_name like concat('%', #{wxMagnet.magnetName}, '%')
|
|
|
</if>
|
|
|
+ <if test="wxMagnet.userType != null and wxMagnet.userType != ''">
|
|
|
+ AND m.user_type = #{wxMagnet.userType}
|
|
|
+ </if>
|
|
|
<if test="wxMagnet.visible != null and wxMagnet.visible != ''">
|
|
|
AND m.visible = #{wxMagnet.visible}
|
|
|
</if>
|
|
|
@@ -177,7 +187,7 @@
|
|
|
</insert>
|
|
|
|
|
|
<select id="selectMagnetByUserId" parameterType="String" resultMap="WxMagnetResult">
|
|
|
- select distinct m.magnet_id, m.magnet_name,m.father_magnet, m.url, m.visible, m.magnet_size
|
|
|
+ select distinct m.magnet_id, m.magnet_name,m.user_type,m.father_magnet, m.url, m.visible, m.magnet_size
|
|
|
, m.bg_url, m.order_num, m.create_time, m.magnet_type, m.applet_qr_url,m.is_encry
|
|
|
from wx_magnet m
|
|
|
left join wx_role_magnet rm on m.magnet_id = rm.magnet_id
|
|
|
@@ -199,7 +209,7 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="selectWxMagnetRoleByUserId" parameterType="String" resultMap="WxMagnetResult">
|
|
|
- select distinct m.magnet_id, m.magnet_name,m.father_magnet, m.url, m.visible, m.magnet_size
|
|
|
+ select distinct m.magnet_id, m.magnet_name,m.user_type,m.father_magnet, m.url, m.visible, m.magnet_size
|
|
|
, m.bg_url, m.order_num, m.create_time, m.magnet_type, m.applet_qr_url,m.is_encry
|
|
|
from wx_magnet m
|
|
|
left join wx_role_magnet rm on m.magnet_id = rm.magnet_id
|
|
|
@@ -213,7 +223,7 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="selectMagnetByCw" parameterType="String" resultMap="WxMagnetResult">
|
|
|
- select distinct m.magnet_id, m.magnet_name,m.father_magnet, m.url, m.visible, m.magnet_size
|
|
|
+ select distinct m.magnet_id, m.magnet_name,m.user_type,m.father_magnet, m.url, m.visible, m.magnet_size
|
|
|
, m.bg_url, m.order_num, m.create_time, m.magnet_type, m.applet_qr_url,m.is_encry
|
|
|
from wx_magnet m
|
|
|
left join wx_role_magnet rm on m.magnet_id = rm.magnet_id
|