<?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.ruoyi.cwgl.mapper.EstimatedReceivableLogMapper">
|
|
<resultMap type="com.ruoyi.cwgl.domain.EstimatedReceivableLog" id="EstimatedReceivableLogResult">
|
<result property="id" column="id" />
|
<result property="estimatedId" column="estimated_id" />
|
<result property="createBy" column="create_by" />
|
<result property="createTime" column="create_time" />
|
<result property="operation" column="operation" />
|
</resultMap>
|
|
<sql id="selectEstimatedReceivableLogVo">
|
select thisTab.id, thisTab.estimated_id, thisTab.create_by, thisTab.create_time, thisTab.operation from estimated_receivable_log AS thisTab
|
</sql>
|
<sql id="selectEstimatedReceivableLogVoCount">
|
select count(0) from estimated_receivable_log as thisTab
|
</sql>
|
|
<sql id="whereCondition">
|
<if test="estimatedId != null "> and thisTab.estimated_id = #{estimatedId}</if>
|
<if test="operation != null and operation != ''"> and thisTab.operation = #{operation}</if>
|
</sql>
|
|
<!--查询-->
|
<select id="selectEstimatedReceivableLogById" parameterType="Integer" resultMap="EstimatedReceivableLogResult">
|
<include refid="selectEstimatedReceivableLogVo"/>
|
where id = #{id}
|
</select>
|
|
<select id="selectEstimatedReceivableLogCount" parameterType="com.ruoyi.cwgl.domain.EstimatedReceivableLog" resultType="int">
|
<include refid="selectEstimatedReceivableLogVoCount"/>
|
<where>
|
<include refid="whereCondition"/>
|
</where>
|
</select>
|
|
<select id="selectEstimatedReceivableLogList" parameterType="com.ruoyi.cwgl.domain.EstimatedReceivableLog" resultMap="EstimatedReceivableLogResult">
|
<include refid="selectEstimatedReceivableLogVo"/>
|
<where>
|
<include refid="whereCondition"/>
|
</where>
|
order by thisTab.id desc
|
</select>
|
|
<!-- 新增 -->
|
<insert id="insertEstimatedReceivableLog" parameterType="com.ruoyi.cwgl.domain.EstimatedReceivableLog" useGeneratedKeys="true" keyProperty="id">
|
insert into estimated_receivable_log
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="estimatedId != null">estimated_id,</if>
|
<if test="createBy != null">create_by,</if>
|
<if test="createTime != null">create_time,</if>
|
<if test="operation != null">operation,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="estimatedId != null">#{estimatedId},</if>
|
<if test="createBy != null">#{createBy},</if>
|
<if test="createTime != null">#{createTime},</if>
|
<if test="operation != null">#{operation},</if>
|
</trim>
|
</insert>
|
|
<insert id="insertEstimatedReceivableLogBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
|
insert into estimated_receivable_log
|
<trim prefix="(" suffix=") values" suffixOverrides=",">
|
id,estimated_id,create_by,create_time,operation,
|
</trim>
|
<foreach item="item" index="index" collection="list" separator=",">
|
<trim prefix="(" suffix=") " suffixOverrides=",">
|
#{item.id},#{item.estimatedId},#{item.createBy},#{item.createTime},#{item.operation},
|
</trim>
|
</foreach>
|
</insert>
|
|
<!-- 修改 -->
|
<update id="updateEstimatedReceivableLog" parameterType="com.ruoyi.cwgl.domain.EstimatedReceivableLog">
|
update estimated_receivable_log
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="estimatedId != null">estimated_id = #{estimatedId},</if>
|
<if test="createBy != null">create_by = #{createBy},</if>
|
<if test="createTime != null">create_time = #{createTime},</if>
|
<if test="operation != null">operation = #{operation},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
<!-- 修改 -->
|
<update id="updateEstimatedReceivableLogBatch" parameterType="java.util.List">
|
<foreach collection="list" item="item" index="index" separator=";">
|
update estimated_receivable_log
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="item.estimatedId != null">estimated_id = #{item.estimatedId},</if>
|
<if test="item.createBy != null">create_by = #{item.createBy},</if>
|
<if test="item.createTime != null">create_time = #{item.createTime},</if>
|
<if test="item.operation != null">operation = #{item.operation},</if>
|
</trim>
|
where id = #{item.id}
|
</foreach>
|
</update>
|
|
<!--删除-->
|
<delete id="deleteEstimatedReceivableLogById" parameterType="Integer">
|
delete from estimated_receivable_log where id = #{id}
|
</delete>
|
<delete id="deleteEstimatedReceivableLogByIds" parameterType="Integer">
|
delete from estimated_receivable_log where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
|
</mapper>
|