|
@ -2,10 +2,6 @@ |
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|
|
<mapper namespace="com.example.demo.mapper.sqlserver.HistoryRecordMapper"> |
|
|
<mapper namespace="com.example.demo.mapper.sqlserver.HistoryRecordMapper"> |
|
|
|
|
|
|
|
|
<select id="getOldHistoryRecord" resultType="com.example.demo.domain.vo.coin.HistoryRecord"> |
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 新增分页查询方法 --> |
|
|
|
|
|
<select id="getNewHistoryRecord" resultType="com.example.demo.domain.vo.coin.HistoryRecord"> |
|
|
<select id="getNewHistoryRecord" resultType="com.example.demo.domain.vo.coin.HistoryRecord"> |
|
|
SELECT |
|
|
SELECT |
|
|
ui.Name AS name, |
|
|
ui.Name AS name, |
|
@ -32,6 +28,29 @@ |
|
|
OFFSET #{offset} ROWS FETCH NEXT #{pageSize} ROWS ONLY |
|
|
OFFSET #{offset} ROWS FETCH NEXT #{pageSize} ROWS ONLY |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 新增分页查询方法 --> |
|
|
|
|
|
<select id="getOldHistoryRecord" resultType="com.example.demo.domain.vo.coin.HistoryRecord"> |
|
|
|
|
|
SELECT |
|
|
|
|
|
ui.Name AS name, |
|
|
|
|
|
hj.jwcode AS jwcode, |
|
|
|
|
|
hj.jbsl AS num, |
|
|
|
|
|
ugt.remark_cn AS updateType, |
|
|
|
|
|
hj.jbtime AS createTime, |
|
|
|
|
|
hj.jbremark AS remark |
|
|
|
|
|
FROM [kstms].[dbo].[hwjt_jbxflogInfo] hj |
|
|
|
|
|
LEFT JOIN [hwerp].[dbo].[UserInfo] ui ON hj.jwcode = ui.Jwcode |
|
|
|
|
|
LEFT JOIN [hwhcGold].[dbo].[user_gold_typeInfo] ugt ON hj.jbzcsrtype = ugt.id |
|
|
|
|
|
<where> |
|
|
|
|
|
<if test="startTime != null">AND hj.jbtime >= #{startTime}</if> |
|
|
|
|
|
<if test="endTime != null">AND hj.jbtime <= #{endTime}</if> |
|
|
|
|
|
<if test="jwcode != null and jwcode!=''">AND hj.jwcode = #{jwcode}</if> |
|
|
|
|
|
<if test="name != null and name!=''">AND ui.Name = #{name}</if> <!-- 修复姓名关联字段 --> |
|
|
|
|
|
</where> |
|
|
|
|
|
ORDER BY hj.jbtime DESC |
|
|
|
|
|
-- SQL Server 手动分页语法 |
|
|
|
|
|
OFFSET #{offset} ROWS FETCH NEXT #{pageSize} ROWS ONLY |
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
<!-- 新增统计总条数的方法 --> |
|
|
<!-- 新增统计总条数的方法 --> |
|
|
<select id="countNewHistoryRecord" resultType="java.lang.Long"> |
|
|
<select id="countNewHistoryRecord" resultType="java.lang.Long"> |
|
|
SELECT COUNT(0) |
|
|
SELECT COUNT(0) |
|
@ -48,4 +67,21 @@ |
|
|
<if test="name != null and name!=''">AND ui.Name = #{name}</if> <!-- 修复姓名关联字段 --> |
|
|
<if test="name != null and name!=''">AND ui.Name = #{name}</if> <!-- 修复姓名关联字段 --> |
|
|
</where> |
|
|
</where> |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 新增统计总条数的方法 --> |
|
|
|
|
|
<select id="countOldHistoryRecord" resultType="java.lang.Long"> |
|
|
|
|
|
SELECT COUNT(0) |
|
|
|
|
|
FROM [kstms].[dbo].[hwjt_jbxflogInfo] hj |
|
|
|
|
|
LEFT JOIN [hwerp].[dbo].[UserInfo] ui ON hj.jwcode = ui.Jwcode |
|
|
|
|
|
LEFT JOIN [hwhcGold].[dbo].[user_gold_typeInfo] ugt ON hj.jbzcsrtype = ugt.id |
|
|
|
|
|
<where> |
|
|
|
|
|
<if test="startTime != null">AND hj.jbtime >= #{startTime}</if> |
|
|
|
|
|
<if test="endTime != null"> |
|
|
|
|
|
<!-- 给 endTime 加 1 秒,语法:DATEADD(second, 1, 时间值) --> |
|
|
|
|
|
AND hj.jbtime <= DATEADD(second, 1, #{endTime}) |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="jwcode != null and jwcode!=''">AND hj.jwcode = #{jwcode}</if> |
|
|
|
|
|
<if test="name != null and name!=''">AND ui.Name = #{name}</if> <!-- 修复姓名关联字段 --> |
|
|
|
|
|
</where> |
|
|
|
|
|
</select> |
|
|
</mapper> |
|
|
</mapper> |