|
|
@@ -0,0 +1,159 @@
|
|
|
+<?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.usoftchina.saas.commons.mapper.ConfigsMapper" >
|
|
|
+ <resultMap id="BaseResultMap" type="com.usoftchina.saas.commons.po.Configs" >
|
|
|
+ <id column="id" property="id" jdbcType="INTEGER" />
|
|
|
+ <result column="code" property="code" jdbcType="VARCHAR" />
|
|
|
+ <result column="description" property="description" jdbcType="VARCHAR" />
|
|
|
+ <result column="data" property="data" jdbcType="VARCHAR" />
|
|
|
+ <result column="companyId" property="companyId" jdbcType="INTEGER" />
|
|
|
+ <result column="creatorName" property="creatorName" jdbcType="VARCHAR" />
|
|
|
+ <result column="creatorId" property="creatorId" jdbcType="INTEGER" />
|
|
|
+ <result column="createTime" property="createTime" jdbcType="TIMESTAMP" />
|
|
|
+ <result column="updaterName" property="updaterName" jdbcType="VARCHAR" />
|
|
|
+ </resultMap>
|
|
|
+ <sql id="Base_Column_List" >
|
|
|
+ id, code, description, data, companyId, creatorName, creatorId, createTime, updaterName
|
|
|
+ </sql>
|
|
|
+ <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
+ from configs
|
|
|
+ where id = #{id,jdbcType=INTEGER}
|
|
|
+ </select>
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
|
|
|
+ delete from configs
|
|
|
+ where id = #{id,jdbcType=INTEGER}
|
|
|
+ </delete>
|
|
|
+ <insert id="insert" parameterType="com.usoftchina.saas.commons.po.Configs" >
|
|
|
+ insert into configs (id, code, description,
|
|
|
+ data, companyId, creatorName,
|
|
|
+ creatorId, createTime, updaterName
|
|
|
+ )
|
|
|
+ values (#{id,jdbcType=INTEGER}, #{code,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR},
|
|
|
+ #{data,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER}, #{creatorName,jdbcType=VARCHAR},
|
|
|
+ #{creatorId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updaterName,jdbcType=VARCHAR}
|
|
|
+ )
|
|
|
+ </insert>
|
|
|
+ <insert id="insertSelective" parameterType="com.usoftchina.saas.commons.po.Configs" >
|
|
|
+ insert into configs
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides="," >
|
|
|
+ <if test="id != null" >
|
|
|
+ id,
|
|
|
+ </if>
|
|
|
+ <if test="code != null" >
|
|
|
+ code,
|
|
|
+ </if>
|
|
|
+ <if test="description != null" >
|
|
|
+ description,
|
|
|
+ </if>
|
|
|
+ <if test="data != null" >
|
|
|
+ data,
|
|
|
+ </if>
|
|
|
+ <if test="companyId != null" >
|
|
|
+ companyId,
|
|
|
+ </if>
|
|
|
+ <if test="creatorName != null" >
|
|
|
+ creatorName,
|
|
|
+ </if>
|
|
|
+ <if test="creatorId != null" >
|
|
|
+ creatorId,
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null" >
|
|
|
+ createTime,
|
|
|
+ </if>
|
|
|
+ <if test="updaterName != null" >
|
|
|
+ updaterName,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides="," >
|
|
|
+ <if test="id != null" >
|
|
|
+ #{id,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="code != null" >
|
|
|
+ #{code,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="description != null" >
|
|
|
+ #{description,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="data != null" >
|
|
|
+ #{data,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="companyId != null" >
|
|
|
+ #{companyId,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="creatorName != null" >
|
|
|
+ #{creatorName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="creatorId != null" >
|
|
|
+ #{creatorId,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null" >
|
|
|
+ #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="updaterName != null" >
|
|
|
+ #{updaterName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.commons.po.Configs" >
|
|
|
+ update configs
|
|
|
+ <set >
|
|
|
+ <if test="code != null" >
|
|
|
+ code = #{code,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="description != null" >
|
|
|
+ description = #{description,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="data != null" >
|
|
|
+ data = #{data,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="companyId != null" >
|
|
|
+ companyId = #{companyId,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="creatorName != null" >
|
|
|
+ creatorName = #{creatorName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="creatorId != null" >
|
|
|
+ creatorId = #{creatorId,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null" >
|
|
|
+ createTime = #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="updaterName != null" >
|
|
|
+ updaterName = #{updaterName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id = #{id,jdbcType=INTEGER}
|
|
|
+ </update>
|
|
|
+ <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.commons.po.Configs" >
|
|
|
+ update configs
|
|
|
+ set code = #{code,jdbcType=VARCHAR},
|
|
|
+ description = #{description,jdbcType=VARCHAR},
|
|
|
+ data = #{data,jdbcType=VARCHAR},
|
|
|
+ companyId = #{companyId,jdbcType=INTEGER},
|
|
|
+ creatorName = #{creatorName,jdbcType=VARCHAR},
|
|
|
+ creatorId = #{creatorId,jdbcType=INTEGER},
|
|
|
+ createTime = #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ updaterName = #{updaterName,jdbcType=VARCHAR}
|
|
|
+ where id = #{id,jdbcType=INTEGER}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <select id="selectByCondition" resultMap="BaseResultMap">
|
|
|
+ select * from configs
|
|
|
+ <where>
|
|
|
+ <if test="con != null">
|
|
|
+ ${con}
|
|
|
+ </if>
|
|
|
+ <if test="companyId != null">
|
|
|
+ and companyId = #{companyId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by id desc
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <update id="updateCreator">
|
|
|
+ update configs set creatorId = #{userId} , creatorName=#{userName} where id=#{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+</mapper>
|