99 lines
4.7 KiB
XML
99 lines
4.7 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.HuayangContactMapper">
|
|
|
|
<resultMap type="com.ruoyi.system.domain.HuayangContact" id="HuayangContactResult">
|
|
<result property="contactId" column="contact_id"/>
|
|
<result property="contactType" column="contact_type"/>
|
|
<result property="contactLabel" column="contact_label"/>
|
|
<result property="contactValue" column="contact_value"/>
|
|
<result property="contactIcon" column="contact_icon"/>
|
|
<result property="sortOrder" column="sort_order"/>
|
|
<result property="isEnabled" column="is_enabled"/>
|
|
<result property="createBy" column="create_by"/>
|
|
<result property="createTime" column="create_time"/>
|
|
<result property="updateBy" column="update_by"/>
|
|
<result property="updateTime" column="update_time"/>
|
|
<result property="remark" column="remark"/>
|
|
</resultMap>
|
|
|
|
<sql id="selectHuayangContactVo">
|
|
SELECT contact_id, contact_type, contact_label, contact_value, contact_icon,
|
|
sort_order, is_enabled, create_by, create_time, update_by, update_time, remark
|
|
FROM huayang_contact
|
|
</sql>
|
|
|
|
<select id="selectHuayangContactList" parameterType="com.ruoyi.system.domain.HuayangContact" resultMap="HuayangContactResult">
|
|
<include refid="selectHuayangContactVo"/>
|
|
<where>
|
|
<if test="contactType != null and contactType != ''">
|
|
AND contact_type = #{contactType}
|
|
</if>
|
|
<if test="isEnabled != null and isEnabled != ''">
|
|
AND is_enabled = #{isEnabled}
|
|
</if>
|
|
</where>
|
|
ORDER BY sort_order ASC
|
|
</select>
|
|
|
|
<select id="selectEnabledContactList" resultMap="HuayangContactResult">
|
|
<include refid="selectHuayangContactVo"/>
|
|
WHERE is_enabled = '1'
|
|
ORDER BY sort_order ASC
|
|
</select>
|
|
|
|
<select id="selectHuayangContactById" parameterType="Long" resultMap="HuayangContactResult">
|
|
<include refid="selectHuayangContactVo"/>
|
|
WHERE contact_id = #{contactId}
|
|
</select>
|
|
|
|
<insert id="insertHuayangContact" parameterType="com.ruoyi.system.domain.HuayangContact" useGeneratedKeys="true" keyProperty="contactId">
|
|
INSERT INTO huayang_contact
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="contactType != null and contactType != ''">contact_type,</if>
|
|
<if test="contactLabel != null and contactLabel != ''">contact_label,</if>
|
|
<if test="contactValue != null and contactValue != ''">contact_value,</if>
|
|
<if test="contactIcon != null">contact_icon,</if>
|
|
<if test="sortOrder != null">sort_order,</if>
|
|
<if test="isEnabled != null">is_enabled,</if>
|
|
<if test="createBy != null">create_by,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="contactType != null and contactType != ''">#{contactType},</if>
|
|
<if test="contactLabel != null and contactLabel != ''">#{contactLabel},</if>
|
|
<if test="contactValue != null and contactValue != ''">#{contactValue},</if>
|
|
<if test="contactIcon != null">#{contactIcon},</if>
|
|
<if test="sortOrder != null">#{sortOrder},</if>
|
|
<if test="isEnabled != null">#{isEnabled},</if>
|
|
<if test="createBy != null">#{createBy},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateHuayangContact" parameterType="com.ruoyi.system.domain.HuayangContact">
|
|
UPDATE huayang_contact
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="contactType != null and contactType != ''">contact_type = #{contactType},</if>
|
|
<if test="contactLabel != null and contactLabel != ''">contact_label = #{contactLabel},</if>
|
|
<if test="contactValue != null and contactValue != ''">contact_value = #{contactValue},</if>
|
|
<if test="contactIcon != null">contact_icon = #{contactIcon},</if>
|
|
<if test="sortOrder != null">sort_order = #{sortOrder},</if>
|
|
<if test="isEnabled != null">is_enabled = #{isEnabled},</if>
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
</trim>
|
|
WHERE contact_id = #{contactId}
|
|
</update>
|
|
|
|
<delete id="deleteHuayangContactById" parameterType="Long">
|
|
DELETE FROM huayang_contact WHERE contact_id = #{contactId}
|
|
</delete>
|
|
|
|
<delete id="deleteHuayangContactByIds" parameterType="Long">
|
|
DELETE FROM huayang_contact WHERE contact_id IN
|
|
<foreach item="contactId" collection="array" open="(" separator="," close=")">
|
|
#{contactId}
|
|
</foreach>
|
|
</delete>
|
|
|
|
</mapper> |