|
@@ -0,0 +1,116 @@
|
|
|
|
+<?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.xlht.xlhtproject.mapper.TXlhtAddRecordMapper">
|
|
|
|
+
|
|
|
|
+ <resultMap type="TXlhtAddRecord" id="TXlhtAddRecordResult">
|
|
|
|
+ <result property="id" column="id" />
|
|
|
|
+ <result property="oneSystemAdd" column="one_system_add" />
|
|
|
|
+ <result property="twoSystemAdd" column="two_system_add" />
|
|
|
|
+ <result property="oneAmount" column="one_amount" />
|
|
|
|
+ <result property="twoAmount" column="two_amount" />
|
|
|
|
+ <result property="realOneAmount" column="real_one_amount" />
|
|
|
|
+ <result property="realTwoAmount" column="real_two_amount" />
|
|
|
|
+ <result property="delFlag" column="del_flag" />
|
|
|
|
+ <result property="revision" column="revision" />
|
|
|
|
+ <result property="createBy" column="create_by" />
|
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
|
+ <result property="updateBy" column="update_by" />
|
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
|
+ <result property="remark" column="remark" />
|
|
|
|
+ </resultMap>
|
|
|
|
+
|
|
|
|
+ <sql id="selectTXlhtAddRecordVo">
|
|
|
|
+ select id, one_system_add, two_system_add, one_amount, two_amount, real_one_amount, real_two_amount, del_flag, revision, create_by, create_time, update_by, update_time, remark from t_xlht_add_record
|
|
|
|
+ </sql>
|
|
|
|
+
|
|
|
|
+ <select id="selectTXlhtAddRecordList" parameterType="TXlhtAddRecord" resultMap="TXlhtAddRecordResult">
|
|
|
|
+ <include refid="selectTXlhtAddRecordVo"/>
|
|
|
|
+ <where>
|
|
|
|
+ 1 = 1
|
|
|
|
+ <if test="oneSystemAdd != null "> and one_system_add = #{oneSystemAdd}</if>
|
|
|
|
+ <if test="twoSystemAdd != null "> and two_system_add = #{twoSystemAdd}</if>
|
|
|
|
+ <if test="oneAmount != null "> and one_amount = #{oneAmount}</if>
|
|
|
|
+ <if test="twoAmount != null "> and two_amount = #{twoAmount}</if>
|
|
|
|
+ <if test="realOneAmount != null "> and real_one_amount = #{realOneAmount}</if>
|
|
|
|
+ <if test="realTwoAmount != null "> and real_two_amount = #{realTwoAmount}</if>
|
|
|
|
+ <if test="revision != null "> and revision = #{revision}</if>
|
|
|
|
+ </where>
|
|
|
|
+ and del_flag = 0 order by id desc
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="selectTXlhtAddRecordById" parameterType="Long" resultMap="TXlhtAddRecordResult">
|
|
|
|
+ <include refid="selectTXlhtAddRecordVo"/>
|
|
|
|
+ where id = #{id} and del_flag = 0
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <insert id="insertTXlhtAddRecord" parameterType="TXlhtAddRecord" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
+ insert into t_xlht_add_record
|
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="oneSystemAdd != null">one_system_add,</if>
|
|
|
|
+ <if test="twoSystemAdd != null">two_system_add,</if>
|
|
|
|
+ <if test="oneAmount != null">one_amount,</if>
|
|
|
|
+ <if test="twoAmount != null">two_amount,</if>
|
|
|
|
+ <if test="realOneAmount != null">real_one_amount,</if>
|
|
|
|
+ <if test="realTwoAmount != null">real_two_amount,</if>
|
|
|
|
+ <if test="delFlag != null">del_flag,</if>
|
|
|
|
+ <if test="revision != null">revision,</if>
|
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
|
+ <if test="remark != null">remark,</if>
|
|
|
|
+ </trim>
|
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="oneSystemAdd != null">#{oneSystemAdd},</if>
|
|
|
|
+ <if test="twoSystemAdd != null">#{twoSystemAdd},</if>
|
|
|
|
+ <if test="oneAmount != null">#{oneAmount},</if>
|
|
|
|
+ <if test="twoAmount != null">#{twoAmount},</if>
|
|
|
|
+ <if test="realOneAmount != null">#{realOneAmount},</if>
|
|
|
|
+ <if test="realTwoAmount != null">#{realTwoAmount},</if>
|
|
|
|
+ <if test="delFlag != null">#{delFlag},</if>
|
|
|
|
+ <if test="revision != null">#{revision},</if>
|
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
|
+ <if test="remark != null">#{remark},</if>
|
|
|
|
+ </trim>
|
|
|
|
+ </insert>
|
|
|
|
+
|
|
|
|
+ <update id="updateTXlhtAddRecord" parameterType="TXlhtAddRecord">
|
|
|
|
+ update t_xlht_add_record
|
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
|
+ <if test="oneSystemAdd != null">one_system_add = #{oneSystemAdd},</if>
|
|
|
|
+ <if test="twoSystemAdd != null">two_system_add = #{twoSystemAdd},</if>
|
|
|
|
+ <if test="oneAmount != null">one_amount = #{oneAmount},</if>
|
|
|
|
+ <if test="twoAmount != null">two_amount = #{twoAmount},</if>
|
|
|
|
+ <if test="realOneAmount != null">real_one_amount = #{realOneAmount},</if>
|
|
|
|
+ <if test="realTwoAmount != null">real_two_amount = #{realTwoAmount},</if>
|
|
|
|
+ <if test="delFlag != null">del_flag = #{delFlag},</if>
|
|
|
|
+ <if test="revision != null">revision = #{revision},</if>
|
|
|
|
+ <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
|
+ <if test="remark != null">remark = #{remark},</if>
|
|
|
|
+ </trim>
|
|
|
|
+ ,revision = revision + 1
|
|
|
|
+ where id = #{id}
|
|
|
|
+ </update>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ <delete id="deleteTXlhtAddRecordById" parameterType="Long">
|
|
|
|
+ update t_xlht_add_record set del_flag = 2,revision = revision + 1 where del_flag = 0 and id = #{id}
|
|
|
|
+ </delete>
|
|
|
|
+
|
|
|
|
+ <delete id="deleteTXlhtAddRecordByIds" parameterType="String">
|
|
|
|
+ update t_xlht_add_record set del_flag = 2,revision = revision + 1 where del_flag = 0 and id in
|
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
+ #{id}
|
|
|
|
+ </foreach>
|
|
|
|
+ </delete>
|
|
|
|
+
|
|
|
|
+</mapper>
|