80 lines
3.6 KiB
XML
80 lines
3.6 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.CmsSuggestMapper">
|
|
|
|
<resultMap type="CmsSuggest" id="CmsSuggestResult">
|
|
<result property="id" column="id" />
|
|
<result property="userName" column="user_name" />
|
|
<result property="emailAddr" column="email_addr" />
|
|
<result property="phoneNumber" column="phone_number" />
|
|
<result property="theme" column="theme" />
|
|
<result property="content" column="content" />
|
|
<result property="createTime" column="create_time" />
|
|
</resultMap>
|
|
|
|
<sql id="selectCmsSuggestVo">
|
|
select id, user_name, email_addr, phone_number, theme, content, create_time from cms_suggest
|
|
</sql>
|
|
|
|
<select id="selectCmsSuggestList" parameterType="CmsSuggest" resultMap="CmsSuggestResult">
|
|
<include refid="selectCmsSuggestVo"/>
|
|
<where>
|
|
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
|
|
<if test="emailAddr != null and emailAddr != ''"> and email_addr = #{emailAddr}</if>
|
|
<if test="phoneNumber != null and phoneNumber != ''"> and phone_number = #{phoneNumber}</if>
|
|
<if test="theme != null and theme != ''"> and theme = #{theme}</if>
|
|
<if test="content != null and content != ''"> and content = #{content}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectCmsSuggestById" parameterType="Long" resultMap="CmsSuggestResult">
|
|
<include refid="selectCmsSuggestVo"/>
|
|
where id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertCmsSuggest" parameterType="CmsSuggest" useGeneratedKeys="true" keyProperty="id">
|
|
insert into cms_suggest
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="userName != null">user_name,</if>
|
|
<if test="emailAddr != null">email_addr,</if>
|
|
<if test="phoneNumber != null">phone_number,</if>
|
|
<if test="theme != null">theme,</if>
|
|
<if test="content != null">content,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="userName != null">#{userName},</if>
|
|
<if test="emailAddr != null">#{emailAddr},</if>
|
|
<if test="phoneNumber != null">#{phoneNumber},</if>
|
|
<if test="theme != null">#{theme},</if>
|
|
<if test="content != null">#{content},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateCmsSuggest" parameterType="CmsSuggest">
|
|
update cms_suggest
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="userName != null">user_name = #{userName},</if>
|
|
<if test="emailAddr != null">email_addr = #{emailAddr},</if>
|
|
<if test="phoneNumber != null">phone_number = #{phoneNumber},</if>
|
|
<if test="theme != null">theme = #{theme},</if>
|
|
<if test="content != null">content = #{content},</if>
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteCmsSuggestById" parameterType="Long">
|
|
delete from cms_suggest where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteCmsSuggestByIds" parameterType="String">
|
|
delete from cms_suggest where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
</mapper> |