|
@@ -0,0 +1,113 @@
|
|
|
+<!DOCTYPE mapper
|
|
|
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
+
|
|
|
+<mapper namespace="com.bosshand.virgo.api.dao.ClauseDao">
|
|
|
+
|
|
|
+ <resultMap type="com.bosshand.virgo.api.model.Clause" id="clauseResult">
|
|
|
+ <id column="id" property="id"/>
|
|
|
+ <result column="contractId" property="contractId"/>
|
|
|
+ <result column="type" property="type"/>
|
|
|
+ <result column="rentWay" property="rentWay"/>
|
|
|
+ <result column="startTime" property="startTime"/>
|
|
|
+ <result column="endTime" property="endTime"/>
|
|
|
+ <result column="unitPrice" property="unitPrice"/>
|
|
|
+ <result column="payTime" property="payTime"/>
|
|
|
+ <result column="chargingType" property="chargingType"/>
|
|
|
+ <result column="unnaturalMonthChargingWay" property="unnaturalMonthChargingWay"/>
|
|
|
+ <result column="yearDays" property="yearDays"/>
|
|
|
+ <result column="payCycle" property="payCycle"/>
|
|
|
+ <result column="leaseTermWay" property="leaseTermWay"/>
|
|
|
+ <result column="earnestMoneyType" property="earnestMoneyType"/>
|
|
|
+ <result column="earnestMoney" property="earnestMoney"/>
|
|
|
+ <result column="currencyType" property="currencyType"/>
|
|
|
+ <result column="incrementalTime" property="incrementalTime"/>
|
|
|
+ <result column="incrementalUnitPrice" property="incrementalUnitPrice"/>
|
|
|
+ <result column="incrementalEarnestMoney" property="incrementalEarnestMoney"/>
|
|
|
+ <result column="preferentialType" property="preferentialType"/>
|
|
|
+ <result column="preferentialStartTime" property="preferentialStartTime"/>
|
|
|
+ <result column="preferentialEndTime" property="preferentialEndTime"/>
|
|
|
+ <result column="preferentialRemark" property="preferentialRemark"/>
|
|
|
+ <result column="preferentialRentFreeWay" property="preferentialRentFreeWay"/>
|
|
|
+ <result column="data" property="data"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <insert id="insert" parameterType="com.bosshand.virgo.api.model.Clause" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ INSERT INTO clause(`contractId`, `type`, `rentWay`, `startTime`, `endTime`, `unitPrice`, `payTime`, `chargingType`, `unnaturalMonthChargingWay`,
|
|
|
+ `yearDays`, `payCycle`, `leaseTermWay`, `earnestMoneyType`, `earnestMoney`, `currencyType`, `incrementalTime`, `incrementalUnitPrice`,
|
|
|
+ `incrementalEarnestMoney`, `preferentialType`, `preferentialStartTime`, `preferentialEndTime`, `preferentialRemark`, `preferentialRentFreeWay`, `data`)
|
|
|
+ VALUES (#{contractId}, #{type}, #{rentWay}, #{startTime}, #{endTime}, #{unitPrice}, #{payTime}, #{chargingType}, #{unnaturalMonthChargingWay},
|
|
|
+ #{yearDays}, #{payCycle}, #{leaseTermWay}, #{earnestMoneyType}, #{earnestMoney}, #{currencyType}, #{incrementalTime}, #{incrementalUnitPrice},
|
|
|
+ #{incrementalEarnestMoney}, #{preferentialType}, #{preferentialStartTime}, #{preferentialEndTime}, #{preferentialRemark}, #{preferentialRentFreeWay}, #{data})
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <delete id="delete">
|
|
|
+ DELETE from clause where id=#{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <update id="update" parameterType="com.bosshand.virgo.api.model.Clause">
|
|
|
+ UPDATE clause
|
|
|
+ <trim prefix="set" suffixOverrides=",">
|
|
|
+ <if test="contractId!=0">contractId=#{contractId},</if>
|
|
|
+ <if test="type!=null">type=#{type},</if>
|
|
|
+ <if test="rentWay!=null">rentWay=#{rentWay},</if>
|
|
|
+ <if test="startTime!=null">startTime=#{startTime},</if>
|
|
|
+ <if test="endTime!=null">endTime=#{endTime},</if>
|
|
|
+ <if test="unitPrice!=null">unitPrice=#{unitPrice},</if>
|
|
|
+ <if test="payTime!=null">payTime=#{payTime},</if>
|
|
|
+ <if test="chargingType!=null">chargingType=#{chargingType},</if>
|
|
|
+ <if test="unnaturalMonthChargingWay!=null">unnaturalMonthChargingWay=#{unnaturalMonthChargingWay},</if>
|
|
|
+ <if test="yearDays!=null">yearDays=#{yearDays},</if>
|
|
|
+ <if test="payCycle!=null">payCycle=#{payCycle},</if>
|
|
|
+ <if test="leaseTermWay!=null">leaseTermWay=#{leaseTermWay},</if>
|
|
|
+ <if test="earnestMoneyType!=null">earnestMoneyType=#{earnestMoneyType},</if>
|
|
|
+ <if test="earnestMoney!=null">earnestMoney=#{earnestMoney},</if>
|
|
|
+ <if test="currencyType!=null">currencyType=#{currencyType},</if>
|
|
|
+ <if test="incrementalTime!=null">incrementalTime=#{incrementalTime},</if>
|
|
|
+ <if test="incrementalUnitPrice!=null">incrementalUnitPrice=#{incrementalUnitPrice},</if>
|
|
|
+ <if test="incrementalEarnestMoney!=null">incrementalEarnestMoney=#{incrementalEarnestMoney},</if>
|
|
|
+ <if test="preferentialType!=null">preferentialType=#{preferentialType},</if>
|
|
|
+ <if test="preferentialStartTime!=null">preferentialStartTime=#{preferentialStartTime},</if>
|
|
|
+ <if test="preferentialEndTime!=null">preferentialEndTime=#{preferentialEndTime},</if>
|
|
|
+ <if test="preferentialRemark!=null">preferentialRemark=#{preferentialRemark},</if>
|
|
|
+ <if test="preferentialRentFreeWay!=null">preferentialRentFreeWay=#{preferentialRentFreeWay},</if>
|
|
|
+ <if test="data!=null">data=#{data},</if>
|
|
|
+ </trim>
|
|
|
+ WHERE id=#{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <select id="get" resultMap="clauseResult">
|
|
|
+ SELECT * FROM clause where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getList" resultMap="clauseResult">
|
|
|
+ SELECT * FROM clause
|
|
|
+ <where>
|
|
|
+ <if test="contractId!=0">and contractId=#{contractId}</if>
|
|
|
+ <if test="type!=null">and type=#{type}</if>
|
|
|
+ <if test="rentWay!=null">and rentWay=#{rentWay}</if>
|
|
|
+ <if test="startTime!=null">and startTime=#{startTime}</if>
|
|
|
+ <if test="endTime!=null">and endTime=#{endTime}</if>
|
|
|
+ <if test="unitPrice!=null">and unitPrice=#{unitPrice}</if>
|
|
|
+ <if test="payTime!=null">and payTime=#{payTime}</if>
|
|
|
+ <if test="chargingType!=null">and chargingType=#{chargingType}</if>
|
|
|
+ <if test="unnaturalMonthChargingWay!=null">and unnaturalMonthChargingWay=#{unnaturalMonthChargingWay}</if>
|
|
|
+ <if test="yearDays!=null">and yearDays=#{yearDays}</if>
|
|
|
+ <if test="payCycle!=null">and payCycle=#{payCycle}</if>
|
|
|
+ <if test="leaseTermWay!=null">and leaseTermWay=#{leaseTermWay}</if>
|
|
|
+ <if test="earnestMoneyType!=null">and earnestMoneyType=#{earnestMoneyType}</if>
|
|
|
+ <if test="earnestMoney!=null">and earnestMoney=#{earnestMoney}</if>
|
|
|
+ <if test="currencyType!=null">and currencyType=#{currencyType}</if>
|
|
|
+ <if test="incrementalTime!=null">and incrementalTime=#{incrementalTime}</if>
|
|
|
+ <if test="incrementalUnitPrice!=null">and incrementalUnitPrice=#{incrementalUnitPrice}</if>
|
|
|
+ <if test="incrementalEarnestMoney!=null">and incrementalEarnestMoney=#{incrementalEarnestMoney}</if>
|
|
|
+ <if test="preferentialType!=null">and preferentialType=#{preferentialType}</if>
|
|
|
+ <if test="preferentialStartTime!=null">and preferentialStartTime=#{preferentialStartTime}</if>
|
|
|
+ <if test="preferentialEndTime!=null">and preferentialEndTime=#{preferentialEndTime}</if>
|
|
|
+ <if test="preferentialRemark!=null">and preferentialRemark=#{preferentialRemark}</if>
|
|
|
+ <if test="preferentialRentFreeWay!=null">and preferentialRentFreeWay=#{preferentialRentFreeWay}</if>
|
|
|
+ <if test="data!=null">and data=#{data}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+</mapper>
|