1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
- <mapper namespace= "com.juxiao.xchat.module.xbd.mapper.system.AppSecretMapper" >
- <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.system.AppSecret" >
- <id column="os" property="os" jdbcType="INTEGER" />
- <result column="sign_key" property="signKey" jdbcType="VARCHAR" />
- <result column="app_version" property="appVersion" jdbcType="VARCHAR" />
- <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
- </resultMap>
- <sql id="Base_Column_List" >
- os, sign_key, app_version, create_time
- </sql>
- <select id="getAppSecretList" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from app_secret_key
- where 1 = 1
- <if test="os != null and os != ''">
- and os = #{os}
- </if>
- <if test="version != null and version != ''">
- and app_version = #{version}
- </if>
- order by app_version desc
- </select>
- <insert id="insert" parameterType="com.juxiao.xchat.module.xbd.domain.system.AppSecret" >
- insert into app_secret_key (os, sign_key, app_version, create_time)
- values (#{os,jdbcType=INTEGER}, #{signKey,jdbcType=VARCHAR}, #{appVersion,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP})
- </insert>
- <select id="getAppSecretBySignKey" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from app_secret_key
- where sign_key = #{signKey} limit 1
- </select>
- <insert id="updateBySignKey" parameterType="com.juxiao.xchat.module.xbd.domain.system.AppSecret" >
- update app_secret_key set os=#{os,jdbcType=INTEGER}, app_version=#{appVersion,jdbcType=VARCHAR}, create_time=now()
- where sign_key=#{signKey,jdbcType=VARCHAR}
- </insert>
- <delete id="deleteBySignKey" parameterType="java.lang.String" >
- delete from app_secret_key
- where sign_key = #{signKey,jdbcType=VARCHAR}
- </delete>
- </mapper>
|