ChoiceMapper.xml 1.2 KB

123456789101112131415161718192021222324252627282930
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.finikes.oc.vote.dao.ChoiceDao">
  4. <insert id="insert" useGeneratedKeys="true" keyProperty="id" keyColumn="id"
  5. parameterType="com.finikes.oc.vote.entity.Choice">
  6. INSERT INTO t_choice (option_id, passport_id, choose_time, proxy, assignee_id)
  7. VALUES (#{optionId}, #{passportId}, #{chooseTime}, #{proxy}, #{assigneeId})
  8. </insert>
  9. <update id="update" parameterType="com.finikes.oc.vote.entity.Choice">
  10. UPDATE t_choice SET option_id = #{optionId}, passport_id = #{passportId}, choose_time = #{chooseTime},
  11. proxy = #{proxy}, assignee_id = #{assigneeId}
  12. WHERE id = #{id}
  13. </update>
  14. <select id="selectByPrimaryKey" parameterType="integer" resultType="com.finikes.oc.vote.entity.Choice">
  15. SELECT id, option_id, passport_id, choose_time, proxy, assignee_id
  16. FROM t_choice
  17. WHERE id = #{primaryKey}
  18. </select>
  19. <delete id="deleteByPrimaryKey" parameterType="integer">
  20. DELETE
  21. FROM t_choice
  22. WHERE id = #{primaryKey}
  23. </delete>
  24. </mapper>