|
|
|
|
@ -26,10 +26,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<result property="qqCount" column="qq" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<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
|
|
|
|
|
</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>
|
|
|
|
|
@ -46,6 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<if test="opinion != null and opinion != ''"> and opinion = #{opinion}</if>
|
|
|
|
|
<if test="userId != null "> and user_id = #{userId}</if>
|
|
|
|
|
</where>
|
|
|
|
|
order by create_time DESC
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectSzxcVoteResultById" parameterType="Long" resultMap="SzxcVoteResultResult">
|
|
|
|
|
@ -62,26 +59,66 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<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">
|
|
|
|
|
<include refid="selectSzxcVoteResultVo"/>
|
|
|
|
|
<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>
|
|
|
|
|
<insert id="insertSzxcVoteResult" parameterType="SzxcVoteResult" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
|
insert into szxc_vote_result
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="ysId != null">ys_id,</if>
|
|
|
|
|
<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="phone != null">phone,</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="ysId != null">#{ysId},</if>
|
|
|
|
|
<if test="jmId != null">#{jmId},</if>
|
|
|
|
|
<if test="cardId != null">#{cardId},</if>
|
|
|
|
|
<if test="voteName != null and voteName != ''">#{voteName},</if>
|
|
|
|
|
<if test="phone != null">#{phone},</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>
|
|
|
|
|
|
|
|
|
|
<select id="selectSzxcVoteResultById" parameterType="Long" resultMap="SzxcVoteResultResult">
|
|
|
|
|
<include refid="selectSzxcVoteResultVo"/>
|
|
|
|
|
<update id="updateSzxcVoteResult" parameterType="SzxcVoteResult">
|
|
|
|
|
update szxc_vote_result
|
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
|
<if test="ysId != null">ys_id = #{ysId},</if>
|
|
|
|
|
<if test="jmId != null">jm_id = #{jmId},</if>
|
|
|
|
|
<if test="cardId != null">card_id = #{cardId},</if>
|
|
|
|
|
<if test="voteName != null and voteName != ''">vote_name = #{voteName},</if>
|
|
|
|
|
<if test="phone != null">phone = #{phone},</if>
|
|
|
|
|
<if test="vote != null">vote = #{vote},</if>
|
|
|
|
|
<if test="opinion != null">opinion = #{opinion},</if>
|
|
|
|
|
<if test="createBy != null">create_by = #{createBy},</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="userId != null">user_id = #{userId},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
where id = #{id}
|
|
|
|
|
</select>
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<delete id="deleteSzxcVoteResultById" parameterType="Long">
|
|
|
|
|
delete from szxc_vote_result where id = #{id}
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteSzxcVoteResultByIds" parameterType="String">
|
|
|
|
|
delete from szxc_vote_result where id in
|
|
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
|
#{id}
|
|
|
|
|
</foreach>
|
|
|
|
|
</delete>
|
|
|
|
|
</mapper>
|