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
<?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.social.mapper.TSocialfundHouseResMapper">
<resultMap id="tSocialfundHouseResMap" type="com.yifu.cloud.plus.v1.yifu.social.entity.TSocialfundHouseRes">
<id property="id" column="ID"/>
<result property="userId" column="USER_ID"/>
<result property="socialHousehold" column="SOCIAL_HOUSEHOLD"/>
<result property="fundHousehold" column="FUND_HOUSEHOLD"/>
<result property="createTime" column="CREATE_TIME"/>
<result property="createBy" column="CREATE_BY"/>
<result property="status" column="STATUS"/>
<result property="userName" column="USER_NAME"/>
<result property="userDeptName" column="USER_DEPT_NAME"/>
<result property="houseNameType" column="HOUSE_NAME_TYPE"/>
<result property="authType" column="AUTH_TYPE"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
a.USER_ID,
a.SOCIAL_HOUSEHOLD,
a.FUND_HOUSEHOLD,
a.CREATE_TIME,
a.CREATE_BY,
a.STATUS,
a.USER_NAME,
a.USER_DEPT_NAME,
a.HOUSE_NAME_TYPE,
a.AUTH_TYPE
</sql>
<sql id="tSocialfundHouseRes_where">
<if test="tSocialfundHouseRes != null">
<if test="tSocialfundHouseRes.idList != null">
AND a.id in
<foreach item="idStr" index="index" collection="tSocialfundHouseRes.idList" open="(" separator=","
close=")">
#{idStr}
</foreach>
</if>
<if test="tSocialfundHouseRes.idList == null">
<if test="tSocialfundHouseRes.socialHousehold != null and tSocialfundHouseRes.socialHousehold.trim() != ''">
AND a.SOCIAL_HOUSEHOLD like concat('%',#{tSocialfundHouseRes.socialHousehold},'%')
</if>
<if test="tSocialfundHouseRes.fundHousehold != null and tSocialfundHouseRes.fundHousehold.trim() != ''">
AND a.FUND_HOUSEHOLD like concat('%',#{tSocialfundHouseRes.fundHousehold},'%')
</if>
<if test="tSocialfundHouseRes.status != null and tSocialfundHouseRes.status.trim() != ''">
AND a.STATUS = #{tSocialfundHouseRes.status}
</if>
<if test="tSocialfundHouseRes.userName != null and tSocialfundHouseRes.userName.trim() != ''">
AND a.USER_NAME like concat('%',#{tSocialfundHouseRes.userName},'%')
</if>
<if test="tSocialfundHouseRes.userDeptName != null and tSocialfundHouseRes.userDeptName.trim() != ''">
AND a.USER_DEPT_NAME like concat('%',#{tSocialfundHouseRes.userDeptName},'%')
</if>
<if test="tSocialfundHouseRes.houseNameType != null and tSocialfundHouseRes.houseNameType.trim() != ''">
AND a.HOUSE_NAME_TYPE = #{tSocialfundHouseRes.houseNameType}
</if>
<if test="tSocialfundHouseRes.authType != null and tSocialfundHouseRes.authType.trim() != ''">
AND a.AUTH_TYPE = #{tSocialfundHouseRes.authType}
</if>
</if>
</if>
</sql>
<!--tSocialfundHouseRes简单分页查询-->
<select id="getTSocialfundHouseResPage" resultMap="tSocialfundHouseResMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_socialfund_house_res a
<where>
1=1
<include refid="tSocialfundHouseRes_where"/>
</where>
order by a.CREATE_TIME desc
</select>
<!--tSocialfundHouseResa导出查询-->
<select id="getexportList" resultMap="tSocialfundHouseResMap">
SELECT
a.SOCIAL_HOUSEHOLD,
a.FUND_HOUSEHOLD,
a.STATUS,
a.USER_NAME,
a.USER_DEPT_NAME,
a.HOUSE_NAME_TYPE
FROM t_socialfund_house_res a
<where>
1=1
<include refid="tSocialfundHouseRes_where"/>
</where>
</select>
<!-- 删权限 -->
<delete id="deleteByUserIdAndHuName">
delete from t_socialfund_house_res where USER_ID = #{tSocialfundHouseRes.userId} and AUTH_TYPE = #{tSocialfundHouseRes.authType}
<if test="tSocialfundHouseRes.socialHousehold != null and tSocialfundHouseRes.socialHousehold.trim() != ''">
AND SOCIAL_HOUSEHOLD = #{tSocialfundHouseRes.socialHousehold}
</if>
<if test="tSocialfundHouseRes.fundHousehold != null and tSocialfundHouseRes.fundHousehold.trim() != ''">
AND FUND_HOUSEHOLD = #{tSocialfundHouseRes.fundHousehold}
</if>
<if test="tSocialfundHouseRes.socialHousehold == null and tSocialfundHouseRes.fundHousehold == null">
AND 1=2
</if>
</delete>
</mapper>