PassportMapper.xml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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.base.dao.PassportDAO">
  4. <insert id="insert" useGeneratedKeys="true" keyProperty="id" keyColumn="id"
  5. parameterType="com.finikes.oc.base.entity.Passport">
  6. INSERT INTO t_passport (mobile, password, veriCode, veriCodeDeadline)
  7. VALUES (#{mobile}, #{password}, #{veriCode}, #{veriCodeDeadline})
  8. </insert>
  9. <select id="findByMobile" parameterType="java.lang.String" resultType="com.finikes.oc.base.entity.Passport">
  10. SELECT id, mobile, password, veriCode, state, veriCodeDeadline
  11. FROM t_passport
  12. WHERE mobile = #{mobile}
  13. </select>
  14. <select id="findById" parameterType="java.lang.Integer" resultType="com.finikes.oc.base.entity.Passport">
  15. SELECT id, mobile, password, veriCode, state, veriCodeDeadline
  16. FROM t_passport
  17. WHERE id = #{id}
  18. </select>
  19. <update id="updateVeriCode" parameterType="com.finikes.oc.base.entity.Passport">
  20. UPDATE t_passport
  21. SET veriCode = #{veriCode},
  22. veriCodeDeadline = #{veriCodeDeadline}
  23. WHERE mobile = #{mobile}
  24. </update>
  25. <update id="updateState" parameterType="com.finikes.oc.base.entity.Passport">
  26. UPDATE t_passport
  27. SET state = #{state},
  28. createTime = #{createTime}
  29. WHERE mobile = #{mobile}
  30. </update>
  31. <update id="updateStateAndPassword" parameterType="com.finikes.oc.base.entity.Passport">
  32. UPDATE t_passport
  33. SET state = #{state},
  34. createTime = #{createTime},
  35. password = #{password}
  36. WHERE mobile = #{mobile}
  37. </update>
  38. <update id="updateName">
  39. UPDATE t_passport
  40. SET name = #{name}
  41. WHERE id = #{id}
  42. </update>
  43. </mapper>