diff options
Diffstat (limited to 'appmarket-persistence/src/main/java/app/market/persistence/xml/app/AppMapper.xml')
-rw-r--r-- | appmarket-persistence/src/main/java/app/market/persistence/xml/app/AppMapper.xml | 368 |
1 files changed, 368 insertions, 0 deletions
diff --git a/appmarket-persistence/src/main/java/app/market/persistence/xml/app/AppMapper.xml b/appmarket-persistence/src/main/java/app/market/persistence/xml/app/AppMapper.xml new file mode 100644 index 0000000..d025f54 --- /dev/null +++ b/appmarket-persistence/src/main/java/app/market/persistence/xml/app/AppMapper.xml @@ -0,0 +1,368 @@ +<?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="app.market.persistence.mapper.app.AppMapper" > + <resultMap id="BaseResultMap" type="App" > + <id column="APP_ID" property="appId" jdbcType="CHAR" /> + <result column="APP_NAME" property="appName" jdbcType="VARCHAR" /> + <result column="APP_ABSTRACT" property="appAbstract" jdbcType="VARCHAR" /> + <result column="APP_TYPE_ID" property="typeId" jdbcType="CHAR" /> + <result column="APP_DEVICE_TYPE_ID" property="appDeviceTypeId" jdbcType="CHAR" /> + <result column="APP_DEVICE_TYPE_NAME" property="appDeviceTypeName" jdbcType="CHAR" /> + <result column="TYPE_NAME" property="typeName" jdbcType="VARCHAR" /> + <result column="DEVELOPER" property="developer" jdbcType="CHAR" /> + <result column="USER_NAME" property="developerName" jdbcType="VARCHAR" /> + <result column="VERSION_NAME" property="versionName" jdbcType="VARCHAR" /> + <result column="FILE_PATH" property="verFilePath" jdbcType="VARCHAR" /> + <result column="SIZE" property="verFileSize" jdbcType="INTEGER" /> + <result column="VERSION_CREATE_DATE" property="verCreateDate" jdbcType="TIMESTAMP" /> + <result column="APP_CREATE_DATE" property="createDate" jdbcType="TIMESTAMP" /> + <result column="APP_UPDATE_DATE" property="updateDate" jdbcType="TIMESTAMP" /> + <result column="APP_IS_DEL" property="isDel" jdbcType="CHAR" /> + <result column="MD5" property="hashcode" jdbcType="CHAR" /> + <result column="APP_IS_PUBLIC" property="appIsPublic" jdbcType="CHAR" /> + <result column="PUBLIC_LABLE" property="appIsPublicLable" jdbcType="CHAR" /> + <result column="APP_VERSION_ID" property="appVersionId" jdbcType="VARCHAR" /> + <result column="APP_ID_CUSTOM" property="appIdCustom" jdbcType="VARCHAR" /> + <result column="IMAGE_PATH" property="imagePath" jdbcType="VARCHAR" /> + </resultMap> + <sql id="Example_Where_Clause" > + <where > + <foreach collection="oredCriteria" item="criteria" separator="or" > + <if test="criteria.valid" > + <trim prefix="(" suffix=")" prefixOverrides="and" > + <foreach collection="criteria.criteria" item="criterion" > + <choose > + <when test="criterion.noValue" > + and ${criterion.condition} + </when> + <when test="criterion.singleValue" > + and ${criterion.condition} #{criterion.value} + </when> + <when test="criterion.betweenValue" > + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + </when> + <when test="criterion.listValue" > + and ${criterion.condition} + <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," > + #{listItem} + </foreach> + </when> + </choose> + </foreach> + </trim> + </if> + </foreach> + </where> + </sql> + <sql id="Update_By_Example_Where_Clause" > + <where > + <foreach collection="example.oredCriteria" item="criteria" separator="or" > + <if test="criteria.valid" > + <trim prefix="(" suffix=")" prefixOverrides="and" > + <foreach collection="criteria.criteria" item="criterion" > + <choose > + <when test="criterion.noValue" > + and ${criterion.condition} + </when> + <when test="criterion.singleValue" > + and ${criterion.condition} #{criterion.value} + </when> + <when test="criterion.betweenValue" > + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + </when> + <when test="criterion.listValue" > + and ${criterion.condition} + <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," > + #{listItem} + </foreach> + </when> + </choose> + </foreach> + </trim> + </if> + </foreach> + </where> + </sql> + <sql id="Base_Column_List" > + APP_ID, APP_NAME, APP_ABSTRACT, + APP_TYPE_ID,APP_ID_CUSTOM,IMAGE_PATH, + (select category.DIC_LABEL + from t_dictionary as category + where category.DIC_VALUE = APP_TYPE_ID and category.DIC_TYPE="0100" + ) as TYPE_NAME, + DEVELOPER,USER_NAME, + APP_VERSION_ID, APP_CREATE_DATE, APP_UPDATE_DATE, APP_IS_DEL, + FILE_PATH, SIZE, VERSION_CREATE_DATE, MD5, VERSION_NAME, + APP_IS_PUBLIC, + (select public.DIC_LABEL + from t_dictionary as public + where public.DIC_VALUE = APP_IS_PUBLIC and public.DIC_TYPE="0102" + ) as PUBLIC_LABLE, + APP_DEVICE_TYPE_ID, + (select device.DIC_LABEL + from t_dictionary as device + where device.DIC_VALUE = APP_DEVICE_TYPE_ID and device.DIC_TYPE="0101" + ) as APP_DEVICE_TYPE_NAME + </sql> + <select id="selectByExample" resultMap="BaseResultMap" parameterType="AppExample" > + select + <if test="distinct" > + distinct + </if> + 'true' as QUERYID, + <include refid="Base_Column_List" /> + from t_app + left join t_user on DEVELOPER = USER_ID + left join t_app_version on (APP_VERSION_ID = VERSION_ID and APP_ID = V_APP_ID) + <if test="_parameter != null" > + <include refid="Example_Where_Clause" /> + </if> + <if test="orderByClause != null" > + order by ${orderByClause} + </if> + </select> + <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" > + select + <include refid="Base_Column_List" /> + from t_app + left join t_user on DEVELOPER = USER_ID + left join t_app_version on (APP_VERSION_ID = VERSION_ID and APP_ID = V_APP_ID) + where APP_ID = #{appId,jdbcType=CHAR} + </select> + <delete id="deleteByPrimaryKey" parameterType="java.lang.String" > + delete from t_app + where APP_ID = #{appId,jdbcType=CHAR} + </delete> + <delete id="deleteByExample" parameterType="AppExample" > + delete from t_app + <if test="_parameter != null" > + <include refid="Example_Where_Clause" /> + </if> + </delete> + <insert id="insert" parameterType="App" > + insert into t_app (APP_ID, APP_NAME, APP_ABSTRACT, + APP_TYPE_ID, APP_DEVICE_TYPE_ID, DEVELOPER, APP_CREATE_DATE, + APP_UPDATE_DATE, APP_IS_DEL,APP_VERSION_ID, APP_IS_PUBLIC, + APP_ID_CUSTOM) + values (#{appId,jdbcType=CHAR}, #{appName,jdbcType=VARCHAR}, #{appAbstract,jdbcType=VARCHAR}, + #{typeId,jdbcType=CHAR}, #{appDeviceTypeId,jdbcType=CHAR}, #{developer,jdbcType=CHAR}, #{createDate,jdbcType=TIMESTAMP}, + #{updateDate,jdbcType=TIMESTAMP}, #{isDel,jdbcType=CHAR}, #{appVersionId,jdbcType=VARCHAR}, #{appIsPublic,jdbcType=CHAR}, + #{appIdCustom,jdbcType=VARCHAR}) + </insert> + <insert id="insertSelective" parameterType="App" > + insert into t_app + <trim prefix="(" suffix=")" suffixOverrides="," > + <if test="appId != null" > + APP_ID, + </if> + <if test="appName != null" > + APP_NAME, + </if> + <if test="appAbstract != null" > + APP_ABSTRACT, + </if> + <if test="typeId != null" > + APP_TYPE_ID, + </if> + <if test="appDeviceTypeId != null" > + APP_DEVICE_TYPE_ID, + </if> + <if test="developer != null" > + DEVELOPER, + </if> + <if test="createDate != null" > + APP_CREATE_DATE, + </if> + <if test="updateDate != null" > + APP_UPDATE_DATE, + </if> + <if test="isDel != null" > + APP_IS_DEL, + </if> + <if test="appVersionId != null" > + APP_VERSION_ID, + </if> + <if test="appIsPublic != null" > + APP_IS_PUBLIC, + </if> + <if test="appIdCustom != null" > + APP_ID_CUSTOM, + </if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides="," > + <if test="appId != null" > + #{appId,jdbcType=CHAR}, + </if> + <if test="appName != null" > + #{appName,jdbcType=VARCHAR}, + </if> + <if test="appAbstract != null" > + #{appAbstract,jdbcType=VARCHAR}, + </if> + <if test="typeId != null" > + #{typeId,jdbcType=CHAR}, + </if> + <if test="appDeviceTypeId != null" > + #{appDeviceTypeId,jdbcType=CHAR}, + </if> + <if test="developer != null" > + #{developer,jdbcType=CHAR}, + </if> + <if test="createDate != null" > + #{createDate,jdbcType=TIMESTAMP}, + </if> + <if test="updateDate != null" > + #{updateDate,jdbcType=TIMESTAMP}, + </if> + <if test="isDel != null" > + #{isDel,jdbcType=CHAR}, + </if> + <if test="appVersionId != null" > + #{appVersionId,jdbcType=VARCHAR}, + </if> + <if test="appIsPublic != null" > + #{appIsPublic,jdbcType=CHAR}, + </if> + <if test="appIdCustom != null" > + #{appIdCustom,jdbcType=VARCHAR}, + </if> + </trim> + </insert> + <select id="countByExample" parameterType="AppExample" resultType="java.lang.Integer" > + select count(*) from t_app + left join t_user on DEVELOPER = USER_ID + <if test="_parameter != null" > + <include refid="Example_Where_Clause" /> + </if> + </select> + <update id="updateByExampleSelective" parameterType="map" > + update t_app + <set > + <if test="record.appId != null" > + APP_ID = #{record.appId,jdbcType=CHAR}, + </if> + <if test="record.appName != null" > + APP_NAME = #{record.appName,jdbcType=VARCHAR}, + </if> + <if test="record.appAbstract != null" > + APP_ABSTRACT = #{record.appAbstract,jdbcType=VARCHAR}, + </if> + <if test="record.typeId != null" > + APP_TYPE_ID = #{record.typeId,jdbcType=CHAR}, + </if> + <if test="record.appDeviceTypeId != null" > + APP_DEVICE_TYPE_ID = #{record.appDeviceTypeId,jdbcType=CHAR}, + </if> + <if test="record.developer != null" > + DEVELOPER = #{record.developer,jdbcType=CHAR}, + </if> + <if test="record.createDate != null" > + APP_CREATE_DATE = #{record.createDate,jdbcType=TIMESTAMP}, + </if> + <if test="record.updateDate != null" > + APP_UPDATE_DATE = #{record.updateDate,jdbcType=TIMESTAMP}, + </if> + <if test="record.isDel != null" > + APP_IS_DEL = #{record.isDel,jdbcType=CHAR}, + </if> + <if test="record.appVersionId != null" > + APP_VERSION_ID = #{record.appVersionId,jdbcType=VARCHAR}, + </if> + <if test="record.appIsPublic != null" > + APP_IS_PUBLIC = #{record.appIsPublic,jdbcType=CHAR}, + </if> + <if test="record.appIdCustom != null" > + APP_ID_CUSTOM = #{record.appIdCustom,jdbcType=VARCHAR}, + </if> + </set> + <if test="_parameter != null" > + <include refid="Update_By_Example_Where_Clause" /> + </if> + </update> + <update id="updateByExample" parameterType="map" > + update t_app + set APP_ID = #{record.appId,jdbcType=CHAR}, + APP_NAME = #{record.appName,jdbcType=VARCHAR}, + APP_ABSTRACT = #{record.appAbstract,jdbcType=VARCHAR}, + APP_TYPE_ID = #{record.typeId,jdbcType=CHAR}, + APP_DEVICE_TYPE_ID = #{record.appDeviceTypeId,jdbcType=CHAR}, + DEVELOPER = #{record.developer,jdbcType=CHAR}, + APP_CREATE_DATE = #{record.createDate,jdbcType=TIMESTAMP}, + APP_UPDATE_DATE = #{record.updateDate,jdbcType=TIMESTAMP}, + APP_VERSION_ID = #{record.appVersionId,jdbcType=VARCHAR}, + APP_IS_DEL = #{record.isDel,jdbcType=CHAR}, + APP_IS_PUBLIC = #{record.appIsPublic,jdbcType=CHAR} + APP_ID_CUSTOM = #{record.appIdCustom,jdbcType=VARCHAR} + <if test="_parameter != null" > + <include refid="Update_By_Example_Where_Clause" /> + </if> + </update> + <update id="updateByPrimaryKeySelective" parameterType="App" > + update t_app + <set > + <if test="appName != null" > + APP_NAME = #{appName,jdbcType=VARCHAR}, + </if> + <if test="appAbstract != null" > + APP_ABSTRACT = #{appAbstract,jdbcType=VARCHAR}, + </if> + <if test="typeId != null" > + APP_TYPE_ID = #{typeId,jdbcType=CHAR}, + </if> + <if test="appDeviceTypeId != null" > + APP_DEVICE_TYPE_ID = #{appDeviceTypeId,jdbcType=CHAR}, + </if> + <if test="developer != null" > + DEVELOPER = #{developer,jdbcType=CHAR}, + </if> + <if test="createDate != null" > + APP_CREATE_DATE = #{createDate,jdbcType=TIMESTAMP}, + </if> + <if test="updateDate != null" > + APP_UPDATE_DATE = #{updateDate,jdbcType=TIMESTAMP}, + </if> + <if test="appVersionId != null" > + APP_VERSION_ID = #{appVersionId,jdbcType=VARCHAR}, + </if> + <if test="isDel != null" > + APP_IS_DEL = #{isDel,jdbcType=CHAR}, + </if> + <if test="appIsPublic != null" > + APP_IS_PUBLIC = #{appIsPublic,jdbcType=CHAR}, + </if> + <if test="appIdCustom != null" > + APP_ID_CUSTOM = #{appIdCustom,jdbcType=VARCHAR}, + </if> + </set> + where APP_ID = #{appId,jdbcType=CHAR} + </update> + <update id="updateByPrimaryKey" parameterType="App" > + update t_app + set APP_NAME = #{appName,jdbcType=VARCHAR}, + APP_ABSTRACT = #{appAbstract,jdbcType=VARCHAR}, + APP_TYPE_ID = #{typeId,jdbcType=CHAR}, + APP_DEVICE_TYPE_ID = #{appDeviceTypeId,jdbcType=CHAR}, + DEVELOPER = #{developer,jdbcType=CHAR}, + APP_CREATE_DATE = #{createDate,jdbcType=TIMESTAMP}, + APP_UPDATE_DATE = #{updateDate,jdbcType=TIMESTAMP}, + APP_VERSION_ID = #{appVersionId,jdbcType=VARCHAR}, + APP_IS_DEL = #{isDel,jdbcType=CHAR}, + APP_IS_PUBLIC = #{appIsPublic,jdbcType=CHAR}, + APP_ID_CUSTOM = #{appIdCustom,jdbcType=VARCHAR} + where APP_ID = #{appId,jdbcType=CHAR} + </update> + <update id="deleteByAppId" parameterType="java.lang.String" > + update t_app + set APP_IS_DEL = "1", APP_ID_CUSTOM = concat(APP_ID_CUSTOM,"-",APP_ID) + where APP_ID = #{appId,jdbcType=CHAR} + </update> + <select id="selectByCustomId" resultMap="BaseResultMap" parameterType="java.lang.String" > + select + <include refid="Base_Column_List" /> + from t_app + left join t_user on DEVELOPER = USER_ID + left join t_app_version on (APP_VERSION_ID = VERSION_ID and APP_ID = V_APP_ID) + where APP_ID_CUSTOM = #{appIdCustom,jdbcType=VARCHAR} + </select> + +</mapper>
\ No newline at end of file |