|
|
|
@ -3,13 +3,14 @@
|
|
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
<mapper namespace="com.ruoyi.szxc.mapper.SzxcVoteResultMapper">
|
|
|
|
<mapper namespace="com.ruoyi.szxc.mapper.SzxcVoteResultMapper">
|
|
|
|
|
|
|
|
|
|
|
|
<resultMap type="SzxcVoteResult" id="SzxcVoteResultResult">
|
|
|
|
<resultMap type="SzxcVoteResult" id="SzxcVoteResultResult">
|
|
|
|
<result property="id" column="id" />
|
|
|
|
<result property="id" column="id" />
|
|
|
|
|
|
|
|
<result property="ysId" column="ys_id" />
|
|
|
|
<result property="jmId" column="jm_id" />
|
|
|
|
<result property="jmId" column="jm_id" />
|
|
|
|
<result property="cardId" column="card_id" />
|
|
|
|
<result property="cardId" column="card_id" />
|
|
|
|
<result property="voteName" column="vote_name" />
|
|
|
|
<result property="voteName" column="vote_name" />
|
|
|
|
<result property="ysId" column="ys_id" />
|
|
|
|
<result property="phone" column="phone" />
|
|
|
|
<result property="vote" column="vote" />
|
|
|
|
<result property="vote" column="vote" />
|
|
|
|
<result property="opinion" column="opinion" />
|
|
|
|
<result property="opinion" column="opinion" />
|
|
|
|
<result property="createBy" column="create_by" />
|
|
|
|
<result property="createBy" column="create_by" />
|
|
|
|
@ -18,85 +19,69 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
<result property="updateTime" column="update_time" />
|
|
|
|
<result property="updateTime" column="update_time" />
|
|
|
|
<result property="userId" column="user_id" />
|
|
|
|
<result property="userId" column="user_id" />
|
|
|
|
</resultMap>
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<resultMap type="YsResult" id="YsResult">
|
|
|
|
|
|
|
|
<result property="ysId" column="ys_id" />
|
|
|
|
|
|
|
|
<result property="tyCount" column="ty" />
|
|
|
|
|
|
|
|
<result property="fdCount" column="fd" />
|
|
|
|
|
|
|
|
<result property="qqCount" column="qq" />
|
|
|
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
|
|
<sql id="selectSzxcVoteResultVo">
|
|
|
|
<sql id="selectSzxcVoteResultVo">
|
|
|
|
select id, jm_id, card_id, vote_name, ys_id, vote, opinion, create_by, create_time, update_by, update_time, user_id from szxc_vote_result
|
|
|
|
select id, jm_id, card_id, vote_name, ys_id, vote, opinion, create_by, create_time, update_by, update_time, user_id from szxc_vote_result
|
|
|
|
</sql>
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<sql id="selectSzxcVoteResultVo">
|
|
|
|
|
|
|
|
select id, ys_id, jm_id, card_id, vote_name, phone, vote, opinion, create_by, create_time, update_by, update_time, user_id from szxc_vote_result
|
|
|
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectSzxcVoteResultList" parameterType="SzxcVoteResult" resultMap="SzxcVoteResultResult">
|
|
|
|
<select id="selectSzxcVoteResultList" parameterType="SzxcVoteResult" resultMap="SzxcVoteResultResult">
|
|
|
|
<include refid="selectSzxcVoteResultVo"/>
|
|
|
|
<include refid="selectSzxcVoteResultVo"/>
|
|
|
|
<where>
|
|
|
|
<where>
|
|
|
|
|
|
|
|
<if test="ysId != null "> and ys_id = #{ysId}</if>
|
|
|
|
<if test="jmId != null "> and jm_id = #{jmId}</if>
|
|
|
|
<if test="jmId != null "> and jm_id = #{jmId}</if>
|
|
|
|
<if test="cardId != null and cardId != ''"> and card_id = #{cardId}</if>
|
|
|
|
<if test="cardId != null and cardId != ''"> and card_id = #{cardId}</if>
|
|
|
|
<if test="voteName != null and voteName != ''"> and vote_name like concat('%', #{voteName}, '%')</if>
|
|
|
|
<if test="voteName != null and voteName != ''"> and vote_name like concat('%', #{voteName}, '%')</if>
|
|
|
|
<if test="ysId != null "> and ys_id = #{ysId}</if>
|
|
|
|
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
|
|
|
|
<if test="vote != null and vote != ''"> and vote = #{vote}</if>
|
|
|
|
<if test="vote != null and vote != ''"> and vote = #{vote}</if>
|
|
|
|
<if test="opinion != null and opinion != ''"> and opinion = #{opinion}</if>
|
|
|
|
<if test="opinion != null and opinion != ''"> and opinion = #{opinion}</if>
|
|
|
|
<if test="userId != null "> and user_id = #{userId}</if>
|
|
|
|
<if test="userId != null "> and user_id = #{userId}</if>
|
|
|
|
</where>
|
|
|
|
</where>
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectSzxcVoteResultById" parameterType="Long" resultMap="SzxcVoteResultResult">
|
|
|
|
<select id="selectSzxcVoteResultById" parameterType="Long" resultMap="SzxcVoteResultResult">
|
|
|
|
<include refid="selectSzxcVoteResultVo"/>
|
|
|
|
<include refid="selectSzxcVoteResultVo"/>
|
|
|
|
where id = #{id}
|
|
|
|
where id = #{id}
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<insert id="insertSzxcVoteResult" parameterType="SzxcVoteResult" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
|
|
|
|
insert into szxc_vote_result
|
|
|
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
|
|
|
<if test="jmId != null">jm_id,</if>
|
|
|
|
|
|
|
|
<if test="cardId != null">card_id,</if>
|
|
|
|
|
|
|
|
<if test="voteName != null and voteName != ''">vote_name,</if>
|
|
|
|
|
|
|
|
<if test="ysId != null">ys_id,</if>
|
|
|
|
|
|
|
|
<if test="vote != null">vote,</if>
|
|
|
|
|
|
|
|
<if test="opinion != null">opinion,</if>
|
|
|
|
|
|
|
|
<if test="createBy != null">create_by,</if>
|
|
|
|
|
|
|
|
<if test="createTime != null">create_time,</if>
|
|
|
|
|
|
|
|
<if test="updateBy != null">update_by,</if>
|
|
|
|
|
|
|
|
<if test="updateTime != null">update_time,</if>
|
|
|
|
|
|
|
|
<if test="userId != null">user_id,</if>
|
|
|
|
|
|
|
|
</trim>
|
|
|
|
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
|
|
|
<if test="jmId != null">#{jmId},</if>
|
|
|
|
|
|
|
|
<if test="cardId != null">#{cardId},</if>
|
|
|
|
|
|
|
|
<if test="voteName != null and voteName != ''">#{voteName},</if>
|
|
|
|
|
|
|
|
<if test="ysId != null">#{ysId},</if>
|
|
|
|
|
|
|
|
<if test="vote != null">#{vote},</if>
|
|
|
|
|
|
|
|
<if test="opinion != null">#{opinion},</if>
|
|
|
|
|
|
|
|
<if test="createBy != null">#{createBy},</if>
|
|
|
|
|
|
|
|
<if test="createTime != null">#{createTime},</if>
|
|
|
|
|
|
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
|
|
|
|
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
|
|
|
|
|
|
<if test="userId != null">#{userId},</if>
|
|
|
|
|
|
|
|
</trim>
|
|
|
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<update id="updateSzxcVoteResult" parameterType="SzxcVoteResult">
|
|
|
|
<!--通过议事id获取投票情况-->
|
|
|
|
update szxc_vote_result
|
|
|
|
<select id="selectSzxcVoteResultByDiscussId" parameterType="Long" resultMap="YsResult">
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
SELECT ys_Id, COUNT(vote = "0" or null) ty,COUNT(vote = "1" or null) fd,COUNT(vote = "2" or null) qq
|
|
|
|
<if test="jmId != null">jm_id = #{jmId},</if>
|
|
|
|
FROM `szxc_vote_result`
|
|
|
|
<if test="cardId != null">card_id = #{cardId},</if>
|
|
|
|
<where>
|
|
|
|
<if test="voteName != null and voteName != ''">vote_name = #{voteName},</if>
|
|
|
|
<if test="ysId != null "> ys_id = #{ysId}</if>
|
|
|
|
<if test="ysId != null">ys_id = #{ysId},</if>
|
|
|
|
</where>
|
|
|
|
<if test="vote != null">vote = #{vote},</if>
|
|
|
|
</select>
|
|
|
|
<if test="opinion != null">opinion = #{opinion},</if>
|
|
|
|
|
|
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
|
|
<sql id="selectSzxcVoteResultVo">
|
|
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
|
|
select id, ys_id, jm_id, card_id, vote_name, phone, vote, opinion, create_by, create_time, update_by, update_time, user_id from szxc_vote_result
|
|
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
|
</sql>
|
|
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
|
|
|
|
|
<if test="userId != null">user_id = #{userId},</if>
|
|
|
|
|
|
|
|
</trim>
|
|
|
|
|
|
|
|
where id = #{id}
|
|
|
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<delete id="deleteSzxcVoteResultById" parameterType="Long">
|
|
|
|
<select id="selectSzxcVoteResultList" parameterType="SzxcVoteResult" resultMap="SzxcVoteResultResult">
|
|
|
|
delete from szxc_vote_result where id = #{id}
|
|
|
|
<include refid="selectSzxcVoteResultVo"/>
|
|
|
|
</delete>
|
|
|
|
<where>
|
|
|
|
|
|
|
|
<if test="ysId != null "> and ys_id = #{ysId}</if>
|
|
|
|
|
|
|
|
<if test="jmId != null "> and jm_id = #{jmId}</if>
|
|
|
|
|
|
|
|
<if test="cardId != null and cardId != ''"> and card_id = #{cardId}</if>
|
|
|
|
|
|
|
|
<if test="voteName != null and voteName != ''"> and vote_name like concat('%', #{voteName}, '%')</if>
|
|
|
|
|
|
|
|
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
|
|
|
|
|
|
|
|
<if test="vote != null and vote != ''"> and vote = #{vote}</if>
|
|
|
|
|
|
|
|
<if test="opinion != null and opinion != ''"> and opinion = #{opinion}</if>
|
|
|
|
|
|
|
|
<if test="userId != null "> and user_id = #{userId}</if>
|
|
|
|
|
|
|
|
</where>
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<delete id="deleteSzxcVoteResultByIds" parameterType="String">
|
|
|
|
<select id="selectSzxcVoteResultById" parameterType="Long" resultMap="SzxcVoteResultResult">
|
|
|
|
delete from szxc_vote_result where id in
|
|
|
|
<include refid="selectSzxcVoteResultVo"/>
|
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
where id = #{id}
|
|
|
|
#{id}
|
|
|
|
</select>
|
|
|
|
</foreach>
|
|
|
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
</mapper>
|
|
|
|
</mapper>
|