90 lines
4.2 KiB
XML
90 lines
4.2 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.system.mapper.HuayangResourceGroupMapper">
|
|
|
|
<resultMap type="com.ruoyi.system.domain.HuayangResourceGroup" id="HuayangResourceGroupResult">
|
|
<result property="groupId" column="group_id"/>
|
|
<result property="groupName" column="group_name"/>
|
|
<result property="groupType" column="group_type"/>
|
|
<result property="groupDesc" column="group_desc"/>
|
|
<result property="sortOrder" column="sort_order"/>
|
|
<result property="status" column="status"/>
|
|
<result property="createBy" column="create_by"/>
|
|
<result property="createTime" column="create_time"/>
|
|
<result property="updateBy" column="update_by"/>
|
|
<result property="updateTime" column="update_time"/>
|
|
</resultMap>
|
|
|
|
<sql id="selectHuayangResourceGroupVo">
|
|
SELECT group_id, group_name, group_type, group_desc, sort_order, status, create_by, create_time, update_by, update_time
|
|
FROM huayang_resource_group
|
|
</sql>
|
|
|
|
<select id="selectHuayangResourceGroupList" parameterType="com.ruoyi.system.domain.HuayangResourceGroup" resultMap="HuayangResourceGroupResult">
|
|
<include refid="selectHuayangResourceGroupVo"/>
|
|
<where>
|
|
<if test="groupName != null and groupName != ''">
|
|
AND group_name LIKE CONCAT('%', #{groupName}, '%')
|
|
</if>
|
|
<if test="groupType != null and groupType != ''">
|
|
AND group_type = #{groupType}
|
|
</if>
|
|
<if test="status != null and status != ''">
|
|
AND status = #{status}
|
|
</if>
|
|
</where>
|
|
ORDER BY sort_order ASC
|
|
</select>
|
|
|
|
<select id="selectHuayangResourceGroupById" parameterType="Long" resultMap="HuayangResourceGroupResult">
|
|
<include refid="selectHuayangResourceGroupVo"/>
|
|
WHERE group_id = #{groupId}
|
|
</select>
|
|
|
|
<insert id="insertHuayangResourceGroup" parameterType="com.ruoyi.system.domain.HuayangResourceGroup" useGeneratedKeys="true" keyProperty="groupId">
|
|
INSERT INTO huayang_resource_group
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="groupName != null and groupName != ''">group_name,</if>
|
|
<if test="groupType != null and groupType != ''">group_type,</if>
|
|
<if test="groupDesc != null">group_desc,</if>
|
|
<if test="sortOrder != null">sort_order,</if>
|
|
<if test="status != null">status,</if>
|
|
<if test="createBy != null">create_by,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="groupName != null and groupName != ''">#{groupName},</if>
|
|
<if test="groupType != null and groupType != ''">#{groupType},</if>
|
|
<if test="groupDesc != null">#{groupDesc},</if>
|
|
<if test="sortOrder != null">#{sortOrder},</if>
|
|
<if test="status != null">#{status},</if>
|
|
<if test="createBy != null">#{createBy},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateHuayangResourceGroup" parameterType="com.ruoyi.system.domain.HuayangResourceGroup">
|
|
UPDATE huayang_resource_group
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="groupName != null and groupName != ''">group_name = #{groupName},</if>
|
|
<if test="groupType != null and groupType != ''">group_type = #{groupType},</if>
|
|
<if test="groupDesc != null">group_desc = #{groupDesc},</if>
|
|
<if test="sortOrder != null">sort_order = #{sortOrder},</if>
|
|
<if test="status != null">status = #{status},</if>
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
</trim>
|
|
WHERE group_id = #{groupId}
|
|
</update>
|
|
|
|
<delete id="deleteHuayangResourceGroupById" parameterType="Long">
|
|
DELETE FROM huayang_resource_group WHERE group_id = #{groupId}
|
|
</delete>
|
|
|
|
<delete id="deleteHuayangResourceGroupByIds" parameterType="Long">
|
|
DELETE FROM huayang_resource_group WHERE group_id IN
|
|
<foreach item="groupId" collection="array" open="(" separator="," close=")">
|
|
#{groupId}
|
|
</foreach>
|
|
</delete>
|
|
|
|
</mapper> |