|
@@ -0,0 +1,107 @@
|
|
|
+<?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.VoteResultMapper">
|
|
|
+
|
|
|
+ <resultMap type="VoteResult" id="VoteResultResult">
|
|
|
+ <result property="voteResultId" column="vote_result_id" />
|
|
|
+ <result property="themeId" column="theme_id" />
|
|
|
+ <result property="themeContent" column="theme_content" />
|
|
|
+ <result property="optionId" column="option_id" />
|
|
|
+ <result property="optionName" column="option_name" />
|
|
|
+ <result property="conferenceRoomOrderId" column="conference_room_order_id" />
|
|
|
+ <result property="userId" column="user_id" />
|
|
|
+ <result property="avatar" column="avatar" />
|
|
|
+ <result property="nickName" column="nick_name" />
|
|
|
+ <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="selectVoteResultVo">
|
|
|
+ select vote_result_id, theme_id, theme_content, option_id, option_name,conference_room_order_id, user_id, avatar, nick_name, create_time, update_by, update_time, remark from vote_result
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectVoteResultList" parameterType="VoteResult" resultMap="VoteResultResult">
|
|
|
+ <include refid="selectVoteResultVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="themeId != null "> and theme_id = #{themeId}</if>
|
|
|
+ <if test="themeContent != null and themeContent != ''"> and theme_content = #{themeContent}</if>
|
|
|
+ <if test="optionId != null "> and option_id = #{optionId}</if>
|
|
|
+ <if test="optionName != null and optionName != ''"> and option_name like concat('%', #{optionName}, '%')</if>
|
|
|
+ <if test="conferenceRoomOrderId != null "> and conference_room_order_id = #{conferenceRoomOrderId}</if>
|
|
|
+ <if test="userId != null "> and user_id = #{userId}</if>
|
|
|
+ <if test="avatar != null and avatar != ''"> and avatar = #{avatar}</if>
|
|
|
+ <if test="nickName != null and nickName != ''"> and nick_name like concat('%', #{nickName}, '%')</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectVoteResultByVoteResultId" parameterType="Long" resultMap="VoteResultResult">
|
|
|
+ <include refid="selectVoteResultVo"/>
|
|
|
+ where vote_result_id = #{voteResultId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertVoteResult" parameterType="VoteResult" useGeneratedKeys="true" keyProperty="voteResultId">
|
|
|
+ insert into vote_result
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="themeId != null">theme_id,</if>
|
|
|
+ <if test="themeContent != null and themeContent != ''">theme_content,</if>
|
|
|
+ <if test="optionId != null">option_id,</if>
|
|
|
+ <if test="optionName != null and optionName != ''">option_name,</if>
|
|
|
+ <if test="conferenceRoomOrderId != null">conference_room_order_id,</if>
|
|
|
+ <if test="userId != null">user_id,</if>
|
|
|
+ <if test="avatar != null">avatar,</if>
|
|
|
+ <if test="nickName != null and nickName != ''">nick_name,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ <if test="remark != null">remark,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="themeId != null">#{themeId},</if>
|
|
|
+ <if test="themeContent != null and themeContent != ''">#{themeContent},</if>
|
|
|
+ <if test="optionId != null">#{optionId},</if>
|
|
|
+ <if test="optionName != null and optionName != ''">#{optionName},</if>
|
|
|
+ <if test="conferenceRoomOrderId != null">#{conferenceRoomOrderId},</if>
|
|
|
+ <if test="userId != null">#{userId},</if>
|
|
|
+ <if test="avatar != null">#{avatar},</if>
|
|
|
+ <if test="nickName != null and nickName != ''">#{nickName},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="remark != null">#{remark},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateVoteResult" parameterType="VoteResult">
|
|
|
+ update vote_result
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="themeId != null">theme_id = #{themeId},</if>
|
|
|
+ <if test="themeContent != null and themeContent != ''">theme_content = #{themeContent},</if>
|
|
|
+ <if test="optionId != null">option_id = #{optionId},</if>
|
|
|
+ <if test="optionName != null and optionName != ''">option_name = #{optionName},</if>
|
|
|
+ <if test="conferenceRoomOrderId != null">conference_room_order_id = #{conferenceRoomOrderId},</if>
|
|
|
+ <if test="userId != null">user_id = #{userId},</if>
|
|
|
+ <if test="avatar != null">avatar = #{avatar},</if>
|
|
|
+ <if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ <if test="remark != null">remark = #{remark},</if>
|
|
|
+ </trim>
|
|
|
+ where vote_result_id = #{voteResultId}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteVoteResultByVoteResultId" parameterType="Long">
|
|
|
+ delete from vote_result where vote_result_id = #{voteResultId}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteVoteResultByVoteResultIds" parameterType="String">
|
|
|
+ delete from vote_result where vote_result_id in
|
|
|
+ <foreach item="voteResultId" collection="array" open="(" separator="," close=")">
|
|
|
+ #{voteResultId}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|