GzptUserInfoMapper.xml 4.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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.miaxis.newgzpt.mapper.GzptUserInfoMapper">
  4. <!-- 定义结果映射 -->
  5. <resultMap type="com.miaxis.newgzpt.vo.GzptExamInfoVO" id="GzptExamInfoVOResultMap">
  6. <result property="userId" column="EI_USER_ID"/>
  7. <result property="userName" column="EI_USERNAME"/>
  8. <result property="kskm" column="EI_KSKM"/>
  9. <result property="score" column="EI_SCORE"/>
  10. <result property="crdate" column="EI_CRDATE"/>
  11. <result property="startDate" column="EI_STARTDATE"/>
  12. <result property="endDate" column="EI_ENDDATE"/>
  13. </resultMap>
  14. <select id="getList" resultType="com.miaxis.newgzpt.domain.GzptUserInfo">
  15. select * from GZPT_USER_INFO
  16. </select>
  17. <select id="getUserByWxlogin" parameterType="com.miaxis.newgzpt.dto.GzptUserInfoDTO" resultType="com.miaxis.newgzpt.domain.GzptUserInfo">
  18. select * from gzpt_user_info g where g.id =
  19. (select max(id) from gzpt_user_info g where g.logincode=#{logincode} and g.password=#{password} and city=#{city})
  20. </select>
  21. <select id="getUserByLoginCodeAndPw" parameterType="com.miaxis.newgzpt.dto.GzptUserInfoDTO" resultType="com.miaxis.newgzpt.domain.GzptUserInfo">
  22. select * from gzpt_user_info g where g.id =
  23. (select max(id) from gzpt_user_info g where g.logincode=#{logincode} and g.password=#{password})
  24. </select>
  25. <select id="getAppleUserInfo" parameterType="com.miaxis.newgzpt.dto.GzptUserInfoDTO" resultType="com.miaxis.newgzpt.domain.GzptUserInfo">
  26. select * from gzpt_user_info g where g.id =
  27. (select max(id) from gzpt_user_info g where g.logincode=#{logincode} and apptype=2)
  28. </select>
  29. <insert id="saveGzptUserInfo" parameterType="com.miaxis.newgzpt.domain.GzptUserInfo">
  30. insert into gzpt_user_info (id,user_name,sex,logincode,CARTYPE,PASSWORD,PHOTO
  31. ,NICKNAME,APPTYPE,CRDATE,pxjd,MN_STATUS,EDU_STATUS)
  32. VALUES (seq_gzpt_user_info.nextval, #{userName},
  33. #{sex},
  34. #{logincode},
  35. #{cartype},
  36. #{password},
  37. #{photo},
  38. #{nickname},
  39. #{apptype,jdbcType=VARCHAR},
  40. #{crdate},
  41. #{pxjd,jdbcType=NUMERIC},
  42. #{mnStatus,jdbcType=NUMERIC},
  43. #{eduStatus,jdbcType=NUMERIC})
  44. </insert>
  45. <select id="getInfoById" resultType="com.miaxis.newgzpt.domain.GzptUserInfo">
  46. select * from GZPT_USER_INFO where id =#{id,jdbcType=NUMERIC}
  47. </select>
  48. <select id="getInfoByOutId" resultType="com.miaxis.newgzpt.domain.GzptUserInfo">
  49. select * from GZPT_USER_INFO where out_id =#{outId,jdbcType=NUMERIC}
  50. </select>
  51. <update id="updateUserBindCoach">
  52. update gzpt_user_info set is_bind_coach = 1 where out_id = #{outId,jdbcType=NUMERIC}
  53. </update>
  54. <update id="updateGzptUserOpenid">
  55. update gzpt_user_info set open_id = #{openid,jdbcType=VARCHAR} where id = (select max(id) from gzpt_user_info g where g.logincode=#{logincode,jdbcType=VARCHAR} and g.password=#{password,jdbcType=VARCHAR})
  56. </update>
  57. <select id="getUserScoreByOutId" resultMap="GzptExamInfoVOResultMap">
  58. select ei_user_id,ei_username,ei_kskm,ei_score,ei_crdate,ei_startdate,ei_enddate from gzpt_exam_info g where ei_user_id = (select id from gzpt_user_info u where u.out_id =#{stuOutId})
  59. order by ei_id desc
  60. </select>
  61. <select id="getUserInfoByOpenid" resultType="com.miaxis.newgzpt.domain.GzptUserInfo">
  62. select * from GZPT_USER_INFO where open_id =#{openid,jdbcType=VARCHAR}
  63. </select>
  64. <select id="getUserInfoCountByOpenid" resultType="Integer">
  65. select count(*) from GZPT_USER_INFO where open_id =#{openid,jdbcType=VARCHAR}
  66. </select>
  67. </mapper>