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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<?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.archives.mapper.FddContractAttachInfoMapper">
<resultMap id="fddContractAttachInfoMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.FddContractAttachInfo">
<id property="id" column="ID"/>
<result property="contractId" column="CONTRACT_ID"/>
<result property="periodStart" column="PERIOD_START"/>
<result property="periodEnd" column="PERIOD_END"/>
<result property="contractStart" column="CONTRACT_START"/>
<result property="contractEnd" column="CONTRACT_END"/>
<result property="periodSalaryPerMonth" column="PERIOD_SALARY_PER_MONTH"/>
<result property="salaryType" column="SALARY_TYPE"/>
<result property="salaryStandardPerHour" column="SALARY_STANDARD_PER_HOUR"/>
<result property="salaryStandardPerPiece" column="SALARY_STANDARD_PER_PIECE"/>
<result property="workSpace" column="WORK_SPACE"/>
<result property="post" column="POST"/>
<result property="remark" column="REMARK"/>
<result property="deleteFlag" column="DELETE_FLAG"/>
<result property="isMove" column="IS_MOVE"/>
<result property="fddTemplateId" column="FDD_TEMPLATE_ID"/>
<result property="empName" column="EMP_NAME"/>
<result property="empIdcard" column="EMP_IDCARD"/>
<result property="empPhone" column="EMP_PHONE"/>
<result property="departNo" column="DEPART_NO"/>
<result property="createBy" column="CREATE_BY"/>
<result property="updateBy" column="UPDATE_BY"/>
<result property="createTime" column="CREATE_TIME"/>
<result property="updateTime" column="UPDATE_TIME"/>
<result property="createName" column="CREATE_NAME"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
a.CONTRACT_ID,
a.PERIOD_START,
a.PERIOD_END,
a.PERIOD_SALARY_PER_MONTH,
a.SALARY_TYPE,
a.SALARY_STANDARD_PER_HOUR,
a.SALARY_STANDARD_PER_PIECE,
a.CREATE_USER_ID,
a.REMARK,
a.DELETE_FLAG,
a.WORK_SPACE,
a.IS_MOVE,
a.FDD_TEMPLATE_ID,
a.EMP_NAME,
a.EMP_IDCARD,
a.EMP_PHONE,
a.DEPART_NO,
a.CONTRACT_START,
a.CONTRACT_END,
a.CREATE_BY,
a.CREATE_NAME,
a.CREATE_TIME,
a.UPDATE_BY,
a.UPDATE_TIME
</sql>
<sql id="fddContractAttachInfo_where">
<if test="fddContractAttachInfo != null">
<if test="fddContractAttachInfo.id != null and fddContractAttachInfo.id.trim() != ''">
AND a.ID = #{fddContractAttachInfo.id}
</if>
<if test="fddContractAttachInfo.contractId != null and fddContractAttachInfo.contractId.trim() != ''">
AND a.CONTRACT_ID = #{fddContractAttachInfo.contractId}
</if>
<if test="fddContractAttachInfo.periodStart != null">
AND a.PERIOD_START = #{fddContractAttachInfo.periodStart}
</if>
<if test="fddContractAttachInfo.periodEnd != null">
AND a.PERIOD_END = #{fddContractAttachInfo.periodEnd}
</if>
<if test="fddContractAttachInfo.periodSalaryPerMonth != null">
AND a.PERIOD_SALARY_PER_MONTH = #{fddContractAttachInfo.periodSalaryPerMonth}
</if>
<if test="fddContractAttachInfo.salaryType != null and fddContractAttachInfo.salaryType.trim() != ''">
AND a.SALARY_TYPE = #{fddContractAttachInfo.salaryType}
</if>
<if test="fddContractAttachInfo.salaryStandardPerHour != null">
AND a.SALARY_STANDARD_PER_HOUR = #{fddContractAttachInfo.salaryStandardPerHour}
</if>
<if test="fddContractAttachInfo.salaryStandardPerPiece != null">
AND a.SALARY_STANDARD_PER_PIECE = #{fddContractAttachInfo.salaryStandardPerPiece}
</if>
<if test="fddContractAttachInfo.createUserId != null and fddContractAttachInfo.createUserId.trim() != ''">
AND a.CREATE_USER_ID = #{fddContractAttachInfo.createUserId}
</if>
<if test="fddContractAttachInfo.fddTemplateId != null and fddContractAttachInfo.fddTemplateId.trim() != ''">
AND a.FDD_TEMPLATE_ID = #{fddContractAttachInfo.fddTemplateId}
</if>
<if test="fddContractAttachInfo.empName != null and fddContractAttachInfo.empName.trim() != ''">
AND a.EMP_NAME = #{fddContractAttachInfo.empName}
</if>
<if test="fddContractAttachInfo.empIdcard != null and fddContractAttachInfo.empIdcard.trim() != ''">
AND a.EMP_IDCARD = #{fddContractAttachInfo.empIdcard}
</if>
<if test="fddContractAttachInfo.empPhone != null and fddContractAttachInfo.empPhone.trim() != ''">
AND a.EMP_PHONE = #{fddContractAttachInfo.empPhone}
</if>
<if test="fddContractAttachInfo.departNo != null and fddContractAttachInfo.departNo.trim() != ''">
AND a.DEPART_NO = #{fddContractAttachInfo.departNo}
</if>
<if test="fddContractAttachInfo.contractStart != null">
AND a.CONTRACT_START = #{fddContractAttachInfo.contractStart}
</if>
<if test="fddContractAttachInfo.contractEnd != null">
AND a.CONTRACT_END = #{fddContractAttachInfo.contractEnd}
</if>
<if test="fddContractAttachInfo.createBy != null and fddContractAttachInfo.createBy.trim() != ''">
AND a.CREATE_BY = #{fddContractAttachInfo.createBy}
</if>
<if test="fddContractAttachInfo.createName != null and fddContractAttachInfo.createName.trim() != ''">
AND a.CREATE_NAME = #{fddContractAttachInfo.createName}
</if>
<if test="fddContractAttachInfo.createTime != null">
AND a.CREATE_TIME = #{fddContractAttachInfo.createTime}
</if>
<if test="fddContractAttachInfo.updateBy != null and fddContractAttachInfo.updateBy.trim() != ''">
AND a.UPDATE_BY = #{fddContractAttachInfo.updateBy}
</if>
<if test="fddContractAttachInfo.updateTime != null">
AND a.UPDATE_TIME = #{fddContractAttachInfo.updateTime}
</if>
</if>
</sql>
<!--fddContractAttachInfo简单分页查询-->
<select id="getFddContractAttachInfoPage" resultMap="fddContractAttachInfoMap">
SELECT
<include refid="Base_Column_List"/>,
i.id FDD_CONTRACT_ID,i.TASK_STATUS,i.SEND_SIGN_STATUS,i.RECEIVE_SIGN_STATUS,i.SIGN_STATUS,i.TASK_ID,i.SIGN_TASK_ID,i.DRAFT_ID,i.REMARK SIGN_REMARK
FROM fdd_contract_attach_info a
left join fdd_contract_info i on a.CONTRACT_ID=i.CONTRACT_ID
<where>
1=1 and a.DELETE_FLAG='0' and (i.DELETE_FLAG='0' or i.id is null )
<include refid="fddContractAttachInfo_where"/>
</where>
order by a.CREATE_TIME desc
</select>
<select id="getListByNoInfoByEmpIdcard" resultType="com.yifu.cloud.plus.v1.yifu.archives.entity.FddContractAttachInfo">
select a.* FROM fdd_contract_attach_info a
left join fdd_contract_info i on a.CONTRACT_ID=i.CONTRACT_ID
left join t_employee_contract_info c on a.CONTRACT_ID=c.ID
left join t_employee_info e on c.EMP_Id=e.ID
where e.EMP_IDCARD=#{empIdcard} and i.id is null and a.DELETE_FLAG='0' order by a.CREATE_TIME desc
</select>
</mapper>