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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ Copyright (c) 2018-2025, lengleng All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
~ modification, are permitted provided that the following conditions are met:
~
~ Redistributions of source code must retain the above copyright notice,
~ this list of conditions and the following disclaimer.
~ Redistributions in binary form must reproduce the above copyright
~ notice, this list of conditions and the following disclaimer in the
~ documentation and/or other materials provided with the distribution.
~ Neither the name of the yifu4cloud.com developer nor the names of its
~ contributors may be used to endorse or promote products derived from
~ this software without specific prior written permission.
~ Author: lengleng (wangiegie@gmail.com)
~
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.salary.mapper.TSalaryAttaMapper">
<resultMap id="tAttaMap" type="com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAtta">
<id property="id" column="ID"/>
<result property="attaName" column="ATTA_NAME"/>
<result property="attaSrc" column="ATTA_SRC"/>
<result property="attaUrl" column="ATTA_URL"/>
<result property="attaSize" column="ATTA_SIZE"/>
<result property="attaType" column="ATTA_TYPE"/>
<result property="linkId" column="LINK_ID"/>
<result property="linkType" column="LINK_TYPE"/>
<result property="engineerType" column="ENGINEER_TYPE"/>
<result property="printRemark" column="print_remark"/>
<result property="recordId" column="record_id"/>
<result property="recordStatus" column="record_status"/>
<result property="createBy" column="CREATE_BY"/>
<result property="createName" column="CREATE_NAME"/>
<result property="createTime" column="CREATE_TIME"/>
<result property="updateBy" column="UPDATE_BY"/>
<result property="updateTime" column="UPDATE_TIME"/>
</resultMap>
<sql id="selectParams">
a.ID,
a.ATTA_NAME,
a.ATTA_SRC,
a.ATTA_URL,
a.ATTA_SIZE,
a.ATTA_TYPE,
a.LINK_ID,
a.LINK_TYPE,
a.ENGINEER_TYPE,
a.print_remark,
a.record_id,
a.record_status,
a.CREATE_BY,
a.CREATE_NAME,
a.CREATE_TIME,
a.UPDATE_BY,
a.UPDATE_TIME
</sql>
<!-- 基础查询 -->
<sql id="tSalaryAtta_where">
<if test="tAtta != null">
<if test="tAtta.id != null and tAtta.id.trim() != ''">
AND ID = #{tAtta.id}
</if>
<if test="tAtta.attaName != null and tAtta.attaName.trim() != ''">
AND ATTA_NAME = #{tAtta.attaName}
</if>
<if test="tAtta.attaSrc != null and tAtta.attaSrc.trim() != ''">
AND ATTA_SRC = #{tAtta.attaSrc}
</if>
<if test="tAtta.attaUrl != null and tAtta.attaUrl.trim() != ''">
AND ATTA_URL = #{tAtta.attaUrl}
</if>
<if test="tAtta.attaSize != null and tAtta.attaSize.trim() != ''">
AND ATTA_SIZE = #{tAtta.attaSize}
</if>
<if test="tAtta.attaType != null and tAtta.attaType.trim() != ''">
AND ATTA_TYPE = #{tAtta.attaType}
</if>
<if test="tAtta.linkId != null and tAtta.linkId.trim() != ''">
AND LINK_ID = #{tAtta.linkId}
</if>
<if test="tAtta.linkType != null">
<if test="tAtta.linkType != 230 and tAtta.linkType != 236">
AND LINK_TYPE = #{tAtta.linkType}
</if>
/* 普通工资以及暂停发以及自定义暂停发流转 */
<if test="tAtta.linkType == 230">
AND LINK_TYPE in (2,3,0,8)
</if>
/* 非扣税以及自定义暂停发流转 */
<if test="tAtta.linkType == 236">
AND LINK_TYPE in (2,3,6)
</if>
</if>
<if test="tAtta.engineerType != null">
AND ENGINEER_TYPE = #{tAtta.engineerType}
</if>
<if test="tAtta.recordId != null and tAtta.recordId.trim() != ''">
AND record_id = #{tAtta.recordId}
</if>
<if test="tAtta.recordStatus != null">
AND record_status = #{tAtta.recordStatus}
</if>
</if>
</sql>
<!--tAtta简单分页查询-->
<select id="getTAttaPage" resultMap="tAttaMap">
SELECT
<include refid="selectParams"/>
FROM t_salary_atta a
<where>
1=1
<include refid="tSalaryAtta_where"/>
</where>
order by CREATE_TIME
</select>
<!--tAtta简单分页查询-->
<select id="getTAttaList" resultMap="tAttaMap">
SELECT
<include refid="selectParams"/>
FROM t_salary_atta a
<where>
1=1
<include refid="tSalaryAtta_where"/>
</where>
order by CREATE_TIME desc
</select>
</mapper>