|
@@ -0,0 +1,118 @@
|
|
|
|
|
+<?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.document.mapper.CurrencyMapper" >
|
|
|
|
|
+ <resultMap id="BaseResultMap" type="com.usoftchina.saas.document.entities.Currency" >
|
|
|
|
|
+ <id column="cr_id" property="id" jdbcType="INTEGER" />
|
|
|
|
|
+ <result column="cr_name" property="name" jdbcType="VARCHAR" />
|
|
|
|
|
+ <result column="cr_rate" property="rate" jdbcType="VARCHAR" />
|
|
|
|
|
+ <result column="companyId" property="companyId" jdbcType="INTEGER" />
|
|
|
|
|
+ <result column="creatorId" property="creatorId" jdbcType="INTEGER" />
|
|
|
|
|
+ <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
|
|
|
|
|
+ <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
|
|
|
|
|
+ <result column="creatorName" property="creatorName" jdbcType="INTEGER" />
|
|
|
|
|
+ <result column="updaterName" property="updaterName" jdbcType="INTEGER" />
|
|
|
|
|
+ <result column="createTime" property="createTime" jdbcType="TIMESTAMP" />
|
|
|
|
|
+ <result column="cr_standard" property="standard" jdbcType="INTEGER" />
|
|
|
|
|
+ </resultMap>
|
|
|
|
|
+ <sql id="Base_Column_List" >
|
|
|
|
|
+ cr_id, cr_name, cr_rate, companyId, creatorId, updaterId, updateTime, creatorName, updaterName, createTime, cr_standard
|
|
|
|
|
+ </sql>
|
|
|
|
|
+ <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
|
|
|
|
|
+ select
|
|
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
|
|
+ from currencys
|
|
|
|
|
+ where cr_id = #{id}
|
|
|
|
|
+ </select>
|
|
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
|
|
|
|
|
+ delete from currencys
|
|
|
|
|
+ where cr_id = #{id}
|
|
|
|
|
+ </delete>
|
|
|
|
|
+ <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Currency" >
|
|
|
|
|
+ insert into Currencys
|
|
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides="," >
|
|
|
|
|
+ <if test="name != null" >
|
|
|
|
|
+ cr_name,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="rate != null">
|
|
|
|
|
+ cr_rate,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="standard != null">
|
|
|
|
|
+ cr_standard,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="companyId != null" >
|
|
|
|
|
+ companyId,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="updaterId != null" >
|
|
|
|
|
+ updaterId,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="updateTime != null" >
|
|
|
|
|
+ updateTime,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="creatorId != null" >
|
|
|
|
|
+ creatorId,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="createTime != null" >
|
|
|
|
|
+ createTime,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="creatorName != null" >
|
|
|
|
|
+ creatorName,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides="," >
|
|
|
|
|
+ <if test="name != null" >
|
|
|
|
|
+ #{name,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="rate != null" >
|
|
|
|
|
+ #{rate,jdbcType=DOUBLE},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="standard != null" >
|
|
|
|
|
+ #{standard,jdbcType=INTEGER},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="companyId != null" >
|
|
|
|
|
+ #{companyId,jdbcType=INTEGER},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="updaterId != null" >
|
|
|
|
|
+ #{updaterId,jdbcType=INTEGER},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="updateTime != null" >
|
|
|
|
|
+ #{updateTime,jdbcType=TIMESTAMP},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="creatorId != null" >
|
|
|
|
|
+ #{creatorId,jdbcType=INTEGER},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="createTime != null" >
|
|
|
|
|
+ #{createTime,jdbcType=TIMESTAMP},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="creatorName != null" >
|
|
|
|
|
+ #{creatorName,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ </insert>
|
|
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Currency" >
|
|
|
|
|
+ update Currencys
|
|
|
|
|
+ <set >
|
|
|
|
|
+ <if test="name != null" >
|
|
|
|
|
+ cr_name = #{name,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="rate != null" >
|
|
|
|
|
+ cr_rate = #{rate,jdbcType=DOUBLE},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="standard != null" >
|
|
|
|
|
+ cr_standard = #{standard,jdbcType=INTEGER},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="companyId != null" >
|
|
|
|
|
+ companyId = #{companyId,jdbcType=INTEGER},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="updaterId != null" >
|
|
|
|
|
+ updaterId = #{updaterId,jdbcType=INTEGER},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="updateTime != null" >
|
|
|
|
|
+ updateTime = #{updateTime,jdbcType=TIMESTAMP},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </set>
|
|
|
|
|
+ where cr_id = #{id}
|
|
|
|
|
+ </update>
|
|
|
|
|
+ <select id="selectByCompanyId" resultMap="BaseResultMap">
|
|
|
|
|
+ SELECT * FROM Currencys where companyId=#{companyId} ORDER BY CR_ID DESC
|
|
|
|
|
+ </select>
|
|
|
|
|
+</mapper>
|