Commit ca056506 by jinxin

物理删除改为逻辑删除

parent 2c30edac
......@@ -27,7 +27,7 @@
select
<include refid="Base_Column_List"/>
from tab_haoban_menu
where menu_code = #{menuCode}
where menu_code = #{menuCode} and status_flag = 1
</select>
<!--新增所有列-->
......@@ -89,7 +89,7 @@
update_time = #{updateTime},
</if>
</set>
where menu_code = #{menuCode}
where menu_code = #{menuCode} and status_flag = 1
</update>
<select id="getAllMenuList" resultMap="TabHaobanMenuMap" >
......@@ -129,6 +129,8 @@
where
b.clerk_type = #{clerkType}
and b.wx_enterprise_id = #{wxEnterpriseId}
and a.status_flag = 1
and b.status_flag = 1
and c.status_flag = 1
and c.menu_code = c.parent_code
<if test="systemFlag != null">
......@@ -146,6 +148,8 @@
where
b.clerk_type = #{clerkType}
and b.wx_enterprise_id = #{wxEnterpriseId}
and a.status_flag = 1
and b.status_flag = 1
and c.status_flag = 1
and c.menu_code != c.parent_code
<if test="systemFlag != null">
......@@ -164,6 +168,8 @@
where
b.clerk_type = #{clerkType}
and b.wx_enterprise_id = #{wxEnterpriseId}
and a.status_flag = 1
and b.status_flag = 1
and c.status_flag = 1
<if test="systemFlag != null">
and b.system_flag = #{systemFlag}
......@@ -211,10 +217,9 @@
where status_flag = 1 and menu_code = #{menuCode}
</select>
<delete id="deleteAll">
delete
from tab_haoban_menu
</delete>
<update id="deleteAll">
UPDATE tab_haoban_menu SET status_flag = 0
</update>
</mapper>
......@@ -26,7 +26,7 @@
select
<include refid="Base_Column_List"/>
from tab_haoban_role
where role_id = #{roleId}
where role_id = #{roleId} and status_flag = 1
</select>
<insert id="insertBatch" keyProperty="roleId" useGeneratedKeys="true">
......@@ -80,14 +80,14 @@
system_flag = #{systemFlag},
</if>
</set>
where role_id = #{roleId}
where role_id = #{roleId} and status_flag = 1
</update>
<select id="getByWxEnterpriseIdAndClerkType" resultMap="TabHaobanRoleMap">
select
<include refid="Base_Column_List"/>
from tab_haoban_role
where wx_enterprise_id = #{wxEnterpriseId}
where wx_enterprise_id = #{wxEnterpriseId} and status_flag = 1
<if test="clerkType != null">
and clerk_type = #{clerkType}
</if>
......@@ -101,7 +101,7 @@
select
count(*)
from tab_haoban_role
where wx_enterprise_id = #{wxEnterpriseId}
where wx_enterprise_id = #{wxEnterpriseId} and status_flag = 1
<if test="systemFlag != null">
and system_flag = #{systemFlag}
</if>
......@@ -111,18 +111,18 @@
select
<include refid="Base_Column_List"/>
from tab_haoban_role
where wx_enterprise_id = #{wxEnterpriseId}
where wx_enterprise_id = #{wxEnterpriseId} and status_flag = 1
<if test="systemFlag != null">
and system_flag = #{systemFlag}
</if>
</select>
<delete id="deleteByWxEnterpriseId">
delete from tab_haoban_role where wx_enterprise_id = #{wxEnterpriseId}
<update id="deleteByWxEnterpriseId">
UPDATE tab_haoban_role SET status_flag = 0 where wx_enterprise_id = #{wxEnterpriseId}
<if test="systemFlag != null">
and system_flag = #{systemFlag}
</if>
</delete>
</update>
</mapper>
......@@ -26,37 +26,37 @@
<delete id="deleteByRoleId">
delete from tab_haoban_role_menu where role_id = #{roleId}
</delete>
<update id="deleteByRoleId">
UPDATE tab_haoban_role_menu SET status_flag = 0 where role_id = #{roleId}
</update>
<select id="getByWxEnterpriseIdAndRoleId" resultType="java.lang.String">
select
menu_code
from tab_haoban_role_menu
where wx_enterprise_id = #{wxEnterpriseId} and role_id = #{roleId}
where wx_enterprise_id = #{wxEnterpriseId} and role_id = #{roleId} and status_flag = 1
</select>
<delete id="deleteByWxEnterpriseId">
delete from tab_haoban_role_menu where wx_enterprise_id = #{wxEnterpriseId}
</delete>
<update id="deleteByWxEnterpriseId">
UPDATE tab_haoban_role_menu SET status_flag = 0 where wx_enterprise_id = #{wxEnterpriseId}
</update>
<select id="getMenuInMenuCodes" resultType="java.lang.String">
select
menu_code
from tab_haoban_role_menu
where wx_enterprise_id = #{wxEnterpriseId} and role_id = #{roleId}
where wx_enterprise_id = #{wxEnterpriseId} and role_id = #{roleId} and status_flag = 1
and menu_code in
<foreach collection="menuCodes" open="(" close=")" separator="," item="item">
#{item}
</foreach>
</select>
<delete id="deleteByMenuCode">
delete from tab_haoban_role_menu where wx_enterprise_id = #{wxEnterpriseId} and menu_code = #{menuCode}
</delete>
<update id="deleteByMenuCode">
UPDATE tab_haoban_role_menu SET status_flag = 0 where wx_enterprise_id = #{wxEnterpriseId} and menu_code = #{menuCode}
</update>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment