123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- <?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.AppVersionMapper" >
- <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.system.AppVersion" >
- <id column="version_id" property="versionId" jdbcType="INTEGER" />
- <result column="os" property="os" jdbcType="VARCHAR" />
- <result column="version" property="version" jdbcType="VARCHAR" />
- <result column="platform" property="platform" jdbcType="VARCHAR" />
- <result column="status" property="status" jdbcType="TINYINT" />
- <result column="version_desc" property="versionDesc" jdbcType="VARCHAR" />
- <result column="publish_time" property="publishTime" jdbcType="TIMESTAMP" />
- <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
- <result column="appid" property="appid" jdbcType="VARCHAR" />
- <result column="download_url" property="downloadUrl" jdbcType="VARCHAR" />
- </resultMap>
- <sql id="Base_Column_List" >
- version_id, os, version, platform, status, version_desc, publish_time, create_time,appid,download_url
- </sql>
- <select id="getAppVersionList" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from app_version
- where 1 = 1
- <if test="os != null and os != ''">
- and os = #{os}
- </if>
- <if test="version != null and version != ''">
- and version = #{version}
- </if>
- order by version desc
- </select>
- <insert id="insert" parameterType="com.juxiao.xchat.module.xbd.domain.system.AppVersion" useGeneratedKeys="true" keyProperty="version_id" >
- insert into app_version
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="os != null" >
- os,
- </if>
- <if test="version != null" >
- version,
- </if>
- <if test="platform != null" >
- platform,
- </if>
- <if test="status != null" >
- status,
- </if>
- <if test="versionDesc != null" >
- version_desc,
- </if>
- <if test="publishTime != null" >
- publish_time,
- </if>
- <if test="createTime != null" >
- create_time,
- </if>
- <if test="appid != null" >
- appid,
- </if>
- <if test="downloadUrl != null" >
- download_url,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="os != null" >
- #{os,jdbcType=VARCHAR},
- </if>
- <if test="version != null" >
- #{version,jdbcType=VARCHAR},
- </if>
- <if test="platform != null" >
- #{platform,jdbcType=VARCHAR},
- </if>
- <if test="status != null" >
- #{status,jdbcType=TINYINT},
- </if>
- <if test="versionDesc != null" >
- #{versionDesc,jdbcType=VARCHAR},
- </if>
- <if test="publishTime != null" >
- #{publishTime,jdbcType=TIMESTAMP},
- </if>
- <if test="createTime != null" >
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="appid != null" >
- #{appid,jdbcType=VARCHAR},
- </if>
- <if test="downloadUrl != null" >
- #{downloadUrl,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <select id="getAppVersionByVersionId" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from app_version
- where version_id = #{versionId,jdbcType=INTEGER}
- </select>
- <update id="updateByVersionId" parameterType="com.juxiao.xchat.module.xbd.domain.system.AppVersion" >
- update app_version
- set
- os = #{os,jdbcType=VARCHAR},
- version = #{version,jdbcType=VARCHAR},
- platform = #{platform,jdbcType=VARCHAR},
- status = #{status,jdbcType=TINYINT},
- version_desc = #{versionDesc,jdbcType=VARCHAR},
- publish_time = #{publishTime,jdbcType=TIMESTAMP},
- appid = #{appid,jdbcType=VARCHAR},
- download_url = #{downloadUrl,jdbcType=VARCHAR}
- where version_id =#{versionId,jdbcType=INTEGER}
- </update>
- <delete id="deleteByVersionId" parameterType="java.lang.Integer" >
- delete from app_version
- where version_id =#{versionId,jdbcType=INTEGER}
- </delete>
- </mapper>
|