Files
intc-cloud/ruoyi-modules/intc-invest/src/main/resources/mapper/invest/BankCardLimitHistoryMapper.xml

140 lines
7.5 KiB
XML

<?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.invest.mapper.BankCardLimitHistoryMapper">
<resultMap type="BankCardLimitHistoryVo" id="BankCardLimitHistoryResult">
<result property="id" column="id" />
<result property="name" column="name" />
<result property="type" column="type" />
<result property="bankCardLendId" column="bank_card_lend_id" />
<result property="afterLimit" column="after_limit" />
<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="delFlag" column="del_flag" />
<result property="remark" column="remark" />
<result property="adjustTime" column="adjust_time" />
<result property="effectDate" column="effect_date" />
<result property="deadlineDate" column="deadline_date" />
<result property="adjustType" column="adjust_type" />
<result property="beforeLimit" column="before_limit" />
<result property="adjustLimit" column="adjust_limit" />
</resultMap>
<sql id="selectBankCardLimitHistoryVo">
select a.id, a.name, a.type, a.bank_card_lend_id, a.after_limit, a.create_by, a.create_time, a.update_by, a.update_time, a.del_flag, a.remark, a.adjust_time, a.effect_date, a.deadline_date, a.adjust_type, a.before_limit, a.adjust_limit from bank_card_limit_history a
</sql>
<select id="selectBankCardLimitHistoryList" parameterType="BankCardLimitHistoryDto" resultMap="BankCardLimitHistoryResult">
<include refid="selectBankCardLimitHistoryVo"/>
<where>
a.del_flag='0'
<if test="name != null and name != ''"> and a.name like '%'|| #{name}||'%'</if>
<if test="type != null and type != ''"> and a.type = #{type}</if>
<if test="bankCardLendId != null "> and a.bank_card_lend_id = #{bankCardLendId}</if>
<if test="afterLimit != null "> and a.after_limit = #{afterLimit}</if>
<if test="adjustTime != null "> and a.adjust_time = #{adjustTime}</if>
<if test="effectDate != null "> and a.effect_date = #{effectDate}</if>
<if test="deadlineDate != null "> and a.deadline_date = #{deadlineDate}</if>
<if test="adjustType != null and adjustType != ''"> and a.adjust_type = #{adjustType}</if>
<if test="beforeLimit != null "> and a.before_limit = #{beforeLimit}</if>
<if test="adjustLimit != null "> and a.adjust_limit = #{adjustLimit}</if>
</where>
order by a.create_time desc
</select>
<select id="selectBankCardLimitHistoryById" parameterType="Long" resultMap="BankCardLimitHistoryResult">
<include refid="selectBankCardLimitHistoryVo"/>
where a.id = #{id}
</select>
<insert id="insertBankCardLimitHistory" parameterType="BankCardLimitHistory">
insert into bank_card_limit_history
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="name != null">name,</if>
<if test="type != null">type,</if>
<if test="bankCardLendId != null">bank_card_lend_id,</if>
<if test="afterLimit != null">after_limit,</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="delFlag != null">del_flag,</if>
<if test="remark != null">remark,</if>
<if test="adjustTime != null">adjust_time,</if>
<if test="effectDate != null">effect_date,</if>
<if test="deadlineDate != null">deadline_date,</if>
<if test="adjustType != null and adjustType != ''">adjust_type,</if>
<if test="beforeLimit != null">before_limit,</if>
<if test="adjustLimit != null">adjust_limit,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="name != null">#{name},</if>
<if test="type != null">#{type},</if>
<if test="bankCardLendId != null">#{bankCardLendId},</if>
<if test="afterLimit != null">#{afterLimit},</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="delFlag != null">#{delFlag},</if>
<if test="remark != null">#{remark},</if>
<if test="adjustTime != null">#{adjustTime},</if>
<if test="effectDate != null">#{effectDate},</if>
<if test="deadlineDate != null">#{deadlineDate},</if>
<if test="adjustType != null and adjustType != ''">#{adjustType},</if>
<if test="beforeLimit != null">#{beforeLimit},</if>
<if test="adjustLimit != null">#{adjustLimit},</if>
</trim>
</insert>
<update id="updateBankCardLimitHistory" parameterType="BankCardLimitHistory">
update bank_card_limit_history
<trim prefix="SET" suffixOverrides=",">
<if test="name != null">name = #{name},</if>
<if test="type != null">type = #{type},</if>
<if test="bankCardLendId != null">bank_card_lend_id = #{bankCardLendId},</if>
<if test="afterLimit != null">after_limit = #{afterLimit},</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="delFlag != null">del_flag = #{delFlag},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="adjustTime != null">adjust_time = #{adjustTime},</if>
<if test="effectDate != null">effect_date = #{effectDate},</if>
<if test="deadlineDate != null">deadline_date = #{deadlineDate},</if>
<if test="adjustType != null and adjustType != ''">adjust_type = #{adjustType},</if>
<if test="beforeLimit != null">before_limit = #{beforeLimit},</if>
<if test="adjustLimit != null">adjust_limit = #{adjustLimit},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteBankCardLimitHistoryById" parameterType="Long">
delete from bank_card_limit_history where id = #{id}
</delete>
<delete id="deleteBankCardLimitHistoryByIds" parameterType="String">
delete from bank_card_limit_history where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<update id="removeBankCardLimitHistoryById" parameterType="Long">
update bank_card_limit_history set del_flag='1' where id = #{id}
</update>
<update id="removeBankCardLimitHistoryByIds" parameterType="String">
update bank_card_limit_history set del_flag='1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>