AccountLogMapper.xml
1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?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="cn.com.polysoft.template.dao.SoaAccountLogMapper" >
<select id="getByBillRecordId" resultType="cn.com.polysoft.template.entity.SoaAccountLogEntity">
<!--select a.* from soa_account_log a left join treaty_soa_info b on a.account_no = b.account_no-->
<!--<where>-->
<!--<if test="recordId != null and recordId != ''">-->
<!--and b.record_id = #{recordId}-->
<!--</if>-->
<!--<if test="batchId != null and batchId != ''">-->
<!--and b.batch_id = #{batchId}-->
<!--</if>-->
<!--<if test="createTimeStart != null and createTimeStart != ''">-->
<!--and a.creat_time >= #{createTimeStart}-->
<!--</if>-->
<!--<if test="createTimeEnd != null and createTimeEnd != ''">-->
<!--and a.creat_time <= #{createTimeEnd}-->
<!--</if>-->
<!--</where>-->
<!--order by a.creat_time desc-->
SELECT
a.*
FROM
soa_account_log a
WHERE
a.account_no = (
SELECT
t.account_no
FROM
treaty_soa_info t
WHERE
t.record_id = #{recordId}
)
AND a.batch_id = #{batchId}
<if test="createTimeStart != null and createTimeStart != ''">
and to_date(a.creat_time,'yyyy-MM-dd') >= to_date(#{createTimeStart},'yyyy-MM-dd')
</if>
<if test="createTimeEnd != null and createTimeEnd != ''">
and to_date(a.creat_time,'yyyy-MM-dd') <= to_date(#{createTimeEnd},'yyyy-MM-dd')
</if>
order by a.creat_time desc
</select>
</mapper>