|
|
|
|
<?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.ruoyi.portal.mapper.HwWebMenuMapper">
|
|
|
|
|
|
|
|
|
|
<resultMap type="HwWebMenu" id="HwWebMenuResult">
|
|
|
|
|
<result property="webMenuId" column="web_menu_id" />
|
|
|
|
|
<result property="parent" column="parent" />
|
|
|
|
|
<result property="ancestors" column="ancestors" />
|
|
|
|
|
<result property="status" column="status" />
|
|
|
|
|
<result property="webMenuName" column="web_menu_name" />
|
|
|
|
|
<result property="tenantId" column="tenant_id" />
|
|
|
|
|
<result property="webMenuPic" column="web_menu__pic" />
|
|
|
|
|
<result property="webMenuType" column="web_menu_type" />
|
|
|
|
|
<result property="order" column="order" />
|
|
|
|
|
<result property="isDelete" column="is_delete" />
|
|
|
|
|
<result property="webMenuNameEnglish" column="web_menu_name_english" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectHwWebMenuVo">
|
|
|
|
|
select web_menu_id, parent, ancestors, status, web_menu_name, tenant_id, web_menu__pic, web_menu_type,
|
|
|
|
|
`order`,
|
|
|
|
|
web_menu_name_english,
|
|
|
|
|
is_delete
|
|
|
|
|
from hw_web_menu
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectHwWebMenuList" parameterType="HwWebMenu" resultMap="HwWebMenuResult">
|
|
|
|
|
<include refid="selectHwWebMenuVo"/>
|
|
|
|
|
<where>
|
|
|
|
|
and is_delete = '0'
|
|
|
|
|
<if test="parent != null "> and parent = #{parent}</if>
|
|
|
|
|
<if test="ancestors != null and ancestors != ''"> and ancestors = #{ancestors}</if>
|
|
|
|
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
|
|
|
|
<if test="webMenuName != null and webMenuName != ''"> and web_menu_name like concat('%', #{webMenuName}, '%')</if>
|
|
|
|
|
<if test="tenantId != null "> and tenant_id = #{tenantId}</if>
|
|
|
|
|
<if test="webMenuPic != null and webMenuPic != ''"> and web_menu__pic = #{webMenuPic}</if>
|
|
|
|
|
<if test="webMenuType != null "> and web_menu_type = #{webMenuType}</if>
|
|
|
|
|
<if test="order != null "> and `order` = #{order}</if>
|
|
|
|
|
<if test="webMenuNameEnglish != null and webMenuNameEnglish != ''"> and web_menu_name_english = #{webMenuNameEnglish}</if>
|
|
|
|
|
</where>
|
|
|
|
|
order by parent, `order` asc, web_menu_id asc
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectHwWebMenuByWebMenuId" parameterType="Long" resultMap="HwWebMenuResult">
|
|
|
|
|
<include refid="selectHwWebMenuVo"/>
|
|
|
|
|
where is_delete = '0' and web_menu_id = #{webMenuId}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<insert id="insertHwWebMenu" parameterType="HwWebMenu" useGeneratedKeys="true" keyProperty="webMenuId">
|
|
|
|
|
insert into hw_web_menu
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="webMenuId != null">web_menu_id,</if>
|
|
|
|
|
<if test="parent != null">parent,</if>
|
|
|
|
|
<if test="ancestors != null">ancestors,</if>
|
|
|
|
|
<if test="status != null">status,</if>
|
|
|
|
|
<if test="webMenuName != null">web_menu_name,</if>
|
|
|
|
|
<if test="tenantId != null">tenant_id,</if>
|
|
|
|
|
<if test="webMenuPic != null">web_menu__pic,</if>
|
|
|
|
|
<if test="webMenuType != null">web_menu_type,</if>
|
|
|
|
|
<if test="order != null">`order`,</if>
|
|
|
|
|
<if test="webMenuNameEnglish != null">web_menu_name_english,</if>
|
|
|
|
|
is_delete,
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="webMenuId != null">#{webMenuId},</if>
|
|
|
|
|
<if test="parent != null">#{parent},</if>
|
|
|
|
|
<if test="ancestors != null">#{ancestors},</if>
|
|
|
|
|
<if test="status != null">#{status},</if>
|
|
|
|
|
<if test="webMenuName != null">#{webMenuName},</if>
|
|
|
|
|
<if test="tenantId != null">#{tenantId},</if>
|
|
|
|
|
<if test="webMenuPic != null">#{webMenuPic},</if>
|
|
|
|
|
<if test="webMenuType != null">#{webMenuType},</if>
|
|
|
|
|
<if test="order != null">#{order},</if>
|
|
|
|
|
<if test="webMenuNameEnglish != null">#{webMenuNameEnglish},</if>
|
|
|
|
|
<choose>
|
|
|
|
|
<when test="isDelete != null and isDelete != ''">#{isDelete},</when>
|
|
|
|
|
<otherwise>'0',</otherwise>
|
|
|
|
|
</choose>
|
|
|
|
|
</trim>
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<update id="updateHwWebMenu" parameterType="HwWebMenu">
|
|
|
|
|
update hw_web_menu
|
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
|
<if test="parent != null">parent = #{parent},</if>
|
|
|
|
|
<if test="ancestors != null">ancestors = #{ancestors},</if>
|
|
|
|
|
<if test="status != null">status = #{status},</if>
|
|
|
|
|
<if test="webMenuName != null">web_menu_name = #{webMenuName},</if>
|
|
|
|
|
<if test="tenantId != null">tenant_id = #{tenantId},</if>
|
|
|
|
|
<if test="webMenuPic != null">web_menu__pic = #{webMenuPic},</if>
|
|
|
|
|
<if test="webMenuType != null">web_menu_type = #{webMenuType},</if>
|
|
|
|
|
<if test="order != null">`order` = #{order},</if>
|
|
|
|
|
<if test="webMenuNameEnglish != null">web_menu_name_english = #{webMenuNameEnglish},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
where web_menu_id = #{webMenuId}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<update id="deleteHwWebMenuByWebMenuId" parameterType="Long">
|
|
|
|
|
update hw_web_menu set is_delete = '1' where web_menu_id = #{webMenuId}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<update id="deleteHwWebMenuByWebMenuIds" parameterType="String">
|
|
|
|
|
update hw_web_menu set is_delete = '1' where web_menu_id in
|
|
|
|
|
<foreach item="webMenuId" collection="array" open="(" separator="," close=")">
|
|
|
|
|
#{webMenuId}
|
|
|
|
|
</foreach>
|
|
|
|
|
</update>
|
|
|
|
|
</mapper>
|