|
|
@@ -0,0 +1,86 @@
|
|
|
+<?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.fs.company.mapper.CompanyRedPacketBalanceLogsMapper">
|
|
|
+
|
|
|
+ <resultMap type="CompanyRedPacketBalanceLogs" id="CompanyRedPacketBalanceLogsResult">
|
|
|
+ <result property="logsId" column="logs_id" />
|
|
|
+ <result property="companyId" column="company_id" />
|
|
|
+ <result property="money" column="money" />
|
|
|
+ <result property="remark" column="remark" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="balance" column="balance" />
|
|
|
+ <result property="logsType" column="logs_type" />
|
|
|
+ <result property="status" column="status" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectCompanyRedPacketBalanceLogsVo">
|
|
|
+ select logs_id, company_id, money, remark, create_time, balance, logs_type, status from company_red_packet_balance_logs
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectCompanyRedPacketBalanceLogsList" parameterType="CompanyRedPacketBalanceLogs" resultMap="CompanyRedPacketBalanceLogsResult">
|
|
|
+ select l.logs_id, l.company_id, l.money, l.remark, l.create_time, l.balance, l.logs_type, l.status,c.company_name
|
|
|
+ from
|
|
|
+ company_red_packet_balance_logs l
|
|
|
+ left join company c on c.company_id = l.company_id
|
|
|
+ <where>
|
|
|
+ <if test="logsId != null "> and l.logs_id = #{logsId}</if>
|
|
|
+ <if test="companyId != null "> and l.company_id = #{companyId}</if>
|
|
|
+ <if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and l.create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
|
|
|
+ <if test="logsType != null "> and l.logs_type = #{logsType}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectCompanyRedPacketBalanceLogsByLogsId" parameterType="Long" resultMap="CompanyRedPacketBalanceLogsResult">
|
|
|
+ <include refid="selectCompanyRedPacketBalanceLogsVo"/>
|
|
|
+ where logs_id = #{logsId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertCompanyRedPacketBalanceLogs" parameterType="CompanyRedPacketBalanceLogs" useGeneratedKeys="true" keyProperty="logsId">
|
|
|
+ insert into company_red_packet_balance_logs
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="companyId != null">company_id,</if>
|
|
|
+ <if test="money != null">money,</if>
|
|
|
+ <if test="remark != null">remark,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="balance != null">balance,</if>
|
|
|
+ <if test="logsType != null">logs_type,</if>
|
|
|
+ <if test="status != null">status,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="companyId != null">#{companyId},</if>
|
|
|
+ <if test="money != null">#{money},</if>
|
|
|
+ <if test="remark != null">#{remark},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="balance != null">#{balance},</if>
|
|
|
+ <if test="logsType != null">#{logsType},</if>
|
|
|
+ <if test="status != null">#{status},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateCompanyRedPacketBalanceLogs" parameterType="CompanyRedPacketBalanceLogs">
|
|
|
+ update company_red_packet_balance_logs
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="companyId != null">company_id = #{companyId},</if>
|
|
|
+ <if test="money != null">money = #{money},</if>
|
|
|
+ <if test="remark != null">remark = #{remark},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="balance != null">balance = #{balance},</if>
|
|
|
+ <if test="logsType != null">logs_type = #{logsType},</if>
|
|
|
+ <if test="status != null">status = #{status},</if>
|
|
|
+ </trim>
|
|
|
+ where logs_id = #{logsId}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteCompanyRedPacketBalanceLogsByLogsId" parameterType="Long">
|
|
|
+ delete from company_red_packet_balance_logs where logs_id = #{logsId}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteCompanyRedPacketBalanceLogsByLogsIds" parameterType="String">
|
|
|
+ delete from company_red_packet_balance_logs where logs_id in
|
|
|
+ <foreach item="logsId" collection="array" open="(" separator="," close=")">
|
|
|
+ #{logsId}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|