wecom-dashboards/excel-handle/src/main/resources/mapper/wecom/CustomerExportDataHistoryMa...

28 lines
1.1 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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.excel.wecom.mapper.CustomerExportDataHistoryMapper">
<!-- 根据客户ID查询最大版本号 -->
<select id="selectMaxVersionByCustomerId" resultType="java.lang.Integer">
SELECT MAX(version)
FROM customer_export_data_history
WHERE customer_id = #{customerId}
</select>
<!-- 根据客户ID和版本号查询历史记录 -->
<select id="selectByCustomerIdAndVersion" resultType="com.ruoyi.excel.wecom.domain.CustomerExportDataHistory">
SELECT *
FROM customer_export_data_history
WHERE customer_id = #{customerId} AND version = #{version}
</select>
<!-- 根据客户ID查询所有历史记录按版本号倒序 -->
<select id="selectHistoryByCustomerId" resultType="com.ruoyi.excel.wecom.domain.CustomerExportDataHistory">
SELECT *
FROM customer_export_data_history
WHERE customer_id = #{customerId}
ORDER BY version DESC
</select>
</mapper>