AppSecretMapper.xml 2.0 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.juxiao.xchat.module.xbd.mapper.system.AppSecretMapper" >
  4. <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.system.AppSecret" >
  5. <id column="os" property="os" jdbcType="INTEGER" />
  6. <result column="sign_key" property="signKey" jdbcType="VARCHAR" />
  7. <result column="app_version" property="appVersion" jdbcType="VARCHAR" />
  8. <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
  9. </resultMap>
  10. <sql id="Base_Column_List" >
  11. os, sign_key, app_version, create_time
  12. </sql>
  13. <select id="getAppSecretList" resultMap="BaseResultMap">
  14. select
  15. <include refid="Base_Column_List" />
  16. from app_secret_key
  17. where 1 = 1
  18. <if test="os != null and os != ''">
  19. and os = #{os}
  20. </if>
  21. <if test="version != null and version != ''">
  22. and app_version = #{version}
  23. </if>
  24. order by app_version desc
  25. </select>
  26. <insert id="insert" parameterType="com.juxiao.xchat.module.xbd.domain.system.AppSecret" >
  27. insert into app_secret_key (os, sign_key, app_version, create_time)
  28. values (#{os,jdbcType=INTEGER}, #{signKey,jdbcType=VARCHAR}, #{appVersion,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP})
  29. </insert>
  30. <select id="getAppSecretBySignKey" resultMap="BaseResultMap">
  31. select
  32. <include refid="Base_Column_List" />
  33. from app_secret_key
  34. where sign_key = #{signKey} limit 1
  35. </select>
  36. <insert id="updateBySignKey" parameterType="com.juxiao.xchat.module.xbd.domain.system.AppSecret" >
  37. update app_secret_key set os=#{os,jdbcType=INTEGER}, app_version=#{appVersion,jdbcType=VARCHAR}, create_time=now()
  38. where sign_key=#{signKey,jdbcType=VARCHAR}
  39. </insert>
  40. <delete id="deleteBySignKey" parameterType="java.lang.String" >
  41. delete from app_secret_key
  42. where sign_key = #{signKey,jdbcType=VARCHAR}
  43. </delete>
  44. </mapper>