You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

189 lines
12 KiB
XML

<?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.HwPortalConfigMapper">
<resultMap type="HwPortalConfig" id="HwPortalConfigResult">
<result property="portalConfigId" column="portal_config_id" />
<result property="portalConfigType" column="portal_config_type" />
<result property="portalConfigTypeId" column="portal_config_type_id" />
<result property="portalConfigTitle" column="portal_config_title" />
<result property="portalConfigOrder" column="portal_config_order" />
<result property="portalConfigDesc" column="portal_config_desc" />
<result property="buttonName" column="button_name" />
<result property="routerAddress" column="router_address" />
<result property="portalConfigPic" column="portal_config_pic" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
<result property="configTypeName" column="config_type_name" />
</resultMap>
<resultMap type="HwPortalConfig" id="HwPortalConfigResult2">
<result property="portalConfigId" column="portal_config_id" />
<result property="portalConfigType" column="portal_config_type" />
<result property="portalConfigTypeId" column="portal_config_type_id" />
<result property="portalConfigTitle" column="portal_config_title" />
<result property="portalConfigOrder" column="portal_config_order" />
<result property="portalConfigDesc" column="portal_config_desc" />
<result property="buttonName" column="button_name" />
<result property="routerAddress" column="router_address" />
<result property="portalConfigPic" column="portal_config_pic" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
<result property="configTypeName" column="config_type_name" />
<result property="homeConfigTypePic" column="home_config_type_pic" />
<result property="homeConfigTypeIcon" column="home_config_type_icon" />
<result property="homeConfigTypeName" column="home_config_type_name" />
<result property="homeConfigTypeClassfication" column="config_type_classfication" />
<result property="parentId" column="parent_id" />
<result property="ancestors" column="ancestors" />
</resultMap>
<sql id="selectHwPortalConfigVo">
select portal_config_id, portal_config_type,portal_config_type_id, portal_config_title, portal_config_order,
portal_config_desc, button_name, router_address, portal_config_pic, create_time, create_by, update_time,
update_by
from hw_portal_config
</sql>
<sql id="selectHwPortalConfigVo2">
select hpc.portal_config_id, hpc.portal_config_type,hpc.portal_config_type_id, hpc.portal_config_title, hpc.portal_config_order,
hpc.portal_config_desc, hpc.button_name, hpc.router_address, hpc.portal_config_pic, hpc.create_time, hpc.create_by, hpc.update_time,
hpc.update_by,
hpct.config_type_name,
hpct.home_config_type_pic,
hpct.config_type_icon,
hpct.home_config_type_name,
hpct.config_type_classfication,
hpct.parent_id,
hpct.ancestors
from hw_portal_config hpc
left join hw_portal_config_type hpct on hpc.portal_config_type_id = hpct.config_type_id
</sql>
<select id="selectHwPortalConfigList" parameterType="HwPortalConfig" resultMap="HwPortalConfigResult">
<include refid="selectHwPortalConfigVo"/>
<where>
<if test="portalConfigType != null and portalConfigType != ''"> and portal_config_type = #{portalConfigType}</if>
<if test="portalConfigTypeId != null "> and portal_config_type_id = #{portalConfigTypeId}</if>
<if test="portalConfigTitle != null and portalConfigTitle != ''"> and portal_config_title like concat('%', #{portalConfigTitle}, '%')</if>
<if test="portalConfigOrder != null "> and portal_config_order = #{portalConfigOrder}</if>
<if test="portalConfigDesc != null and portalConfigDesc != ''"> and portal_config_desc = #{portalConfigDesc}</if>
<if test="buttonName != null and buttonName != ''"> and button_name like concat('%', #{buttonName}, '%')</if>
<if test="routerAddress != null and routerAddress != ''"> and router_address = #{routerAddress}</if>
<if test="portalConfigPic != null and portalConfigPic != ''"> and portal_config_pic = #{portalConfigPic}</if>
</where>
</select>
<select id="selectHwPortalConfigList2" parameterType="HwPortalConfig" resultMap="HwPortalConfigResult2">
<include refid="selectHwPortalConfigVo2"/>
<where>
<if test="portalConfigType != null and portalConfigType != ''"> and portal_config_type = #{portalConfigType}</if>
<if test="portalConfigTypeId != null "> and portal_config_type_id = #{portalConfigTypeId}</if>
<if test="portalConfigTitle != null and portalConfigTitle != ''"> and portal_config_title like concat('%', #{portalConfigTitle}, '%')</if>
<if test="portalConfigOrder != null "> and portal_config_order = #{portalConfigOrder}</if>
<if test="portalConfigDesc != null and portalConfigDesc != ''"> and portal_config_desc = #{portalConfigDesc}</if>
<if test="buttonName != null and buttonName != ''"> and button_name like concat('%', #{buttonName}, '%')</if>
<if test="routerAddress != null and routerAddress != ''"> and router_address = #{routerAddress}</if>
<if test="portalConfigPic != null and portalConfigPic != ''"> and portal_config_pic = #{portalConfigPic}</if>
</where>
</select>
<select id="selectHwPortalConfigByPortalConfigId" parameterType="Long" resultMap="HwPortalConfigResult">
<include refid="selectHwPortalConfigVo"/>
where portal_config_id = #{portalConfigId}
</select>
<insert id="insertHwPortalConfig" parameterType="HwPortalConfig" useGeneratedKeys="true" keyProperty="portalConfigId">
insert into hw_portal_config
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="portalConfigType != null and portalConfigType != ''">portal_config_type,</if>
<if test="portalConfigTypeId != null">portal_config_type_id,</if>
<if test="portalConfigTitle != null and portalConfigTitle != ''">portal_config_title,</if>
<if test="portalConfigOrder != null">portal_config_order,</if>
<if test="portalConfigDesc != null">portal_config_desc,</if>
<if test="buttonName != null">button_name,</if>
<if test="routerAddress != null">router_address,</if>
<if test="portalConfigPic != null and portalConfigPic != ''">portal_config_pic,</if>
<if test="createTime != null">create_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="updateBy != null">update_by,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="portalConfigType != null and portalConfigType != ''">#{portalConfigType},</if>
<if test="portalConfigTypeId != null">#{portalConfigTypeId},</if>
<if test="portalConfigTitle != null and portalConfigTitle != ''">#{portalConfigTitle},</if>
<if test="portalConfigOrder != null">#{portalConfigOrder},</if>
<if test="portalConfigDesc != null">#{portalConfigDesc},</if>
<if test="buttonName != null">#{buttonName},</if>
<if test="routerAddress != null">#{routerAddress},</if>
<if test="portalConfigPic != null and portalConfigPic != ''">#{portalConfigPic},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="updateBy != null">#{updateBy},</if>
</trim>
</insert>
<update id="updateHwPortalConfig" parameterType="HwPortalConfig">
update hw_portal_config
<trim prefix="SET" suffixOverrides=",">
<if test="portalConfigType != null and portalConfigType != ''">portal_config_type = #{portalConfigType},</if>
<if test="portalConfigTypeId != null">portal_config_type_id = #{portalConfigTypeId},</if>
<if test="portalConfigTitle != null and portalConfigTitle != ''">portal_config_title = #{portalConfigTitle},</if>
<if test="portalConfigOrder != null">portal_config_order = #{portalConfigOrder},</if>
<if test="portalConfigDesc != null">portal_config_desc = #{portalConfigDesc},</if>
<if test="buttonName != null">button_name = #{buttonName},</if>
<if test="routerAddress != null">router_address = #{routerAddress},</if>
<if test="portalConfigPic != null and portalConfigPic != ''">portal_config_pic = #{portalConfigPic},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
</trim>
where portal_config_id = #{portalConfigId}
</update>
<delete id="deleteHwPortalConfigByPortalConfigId" parameterType="Long">
delete from hw_portal_config where portal_config_id = #{portalConfigId}
</delete>
<delete id="deleteHwPortalConfigByPortalConfigIds" parameterType="String">
delete from hw_portal_config where portal_config_id in
<foreach item="portalConfigId" collection="array" open="(" separator="," close=")">
#{portalConfigId}
</foreach>
</delete>
<sql id="selectHwPortalConfigJoinVo">
select hpc.portal_config_id, hpc.portal_config_type,hpc.portal_config_type_id,
hpc.portal_config_title, hpc.portal_config_order, hpc.portal_config_desc,
hpc.button_name, hpc.router_address, hpc.portal_config_pic,
hpc.create_time, hpc.create_by, hpc.update_time, hpc.update_by,hpct.config_type_name from hw_portal_config hpc
left join hw_portal_config_type hpct on hpc.portal_config_type_id = hpct.config_type_id
</sql>
<select id="selectHwPortalConfigJoinList" parameterType="HwPortalConfig" resultMap="HwPortalConfigResult">
<include refid="selectHwPortalConfigJoinVo"/>
<where>
<if test="portalConfigType != null and portalConfigType != ''"> and hpc.portal_config_type = #{portalConfigType}</if>
<if test="portalConfigTypeId != null "> and hpc.portal_config_type_id = #{portalConfigTypeId}</if>
<if test="portalConfigTitle != null and portalConfigTitle != ''"> and hpc.portal_config_title like concat('%', #{portalConfigTitle}, '%')</if>
<if test="portalConfigOrder != null "> and hpc.portal_config_order = #{portalConfigOrder}</if>
<if test="portalConfigDesc != null and portalConfigDesc != ''"> and hpc.portal_config_desc = #{portalConfigDesc}</if>
<if test="buttonName != null and buttonName != ''"> and hpc.button_name like concat('%', #{buttonName}, '%')</if>
<if test="routerAddress != null and routerAddress != ''"> and hpc.router_address = #{routerAddress}</if>
<if test="portalConfigPic != null and portalConfigPic != ''"> and hpc.portal_config_pic = #{portalConfigPic}</if>
</where>
</select>
</mapper>