MemberUnitMapper.xml
8.02 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
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
<?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="com.lhcredit.project.business.memberUnit.mapper.MemberUnitMapper">
<resultMap type="MemberUnit" id="MemberUnitResult">
<result property="id" column="id" />
<result property="oid" column="oid" />
<result property="name" column="name" />
<result property="creditNo" column="credit_no" />
<result property="orgType" column="org_type" />
<result property="status" column="status" />
<result property="operName" column="oper_name" />
<result property="regAddress" column="reg_address" />
<result property="startDate" column="start_date" />
<result property="scope" column="scope" />
<result property="registCapi" column="regist_capi" />
<result property="scopeType" column="scope_type" />
<result property="department" column="department" />
<result property="creditLevel" column="credit_level" />
<result property="creditScore" column="credit_score" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="delStatus" column="del_status" />
</resultMap>
<sql id="selectMemberUnitVo">
select id, oid, name, credit_no, org_type, status, oper_name, reg_address, start_date, scope, regist_capi, scope_type, department, credit_level, credit_score, create_time, update_time, del_status from member_unit
</sql>
<select id="selectMemberUnitList" parameterType="MemberUnit" resultMap="MemberUnitResult">
<include refid="selectMemberUnitVo"/>
<where>
<if test="id != null "> and id = #{id}</if>
<if test="oid != null "> and oid = #{oid}</if>
<if test="name != null and name != '' "> and name = #{name}</if>
<if test="creditNo != null and creditNo != '' "> and credit_no = #{creditNo}</if>
<if test="orgType != null and orgType != '' "> and org_type = #{orgType}</if>
<if test="status != null and status != '' "> and status = #{status}</if>
<if test="operName != null and operName != '' "> and oper_name = #{operName}</if>
<if test="regAddress != null and regAddress != '' "> and reg_address = #{regAddress}</if>
<if test="startDate != null and startDate != '' "> and start_date = #{startDate}</if>
<if test="scope != null and scope != '' "> and scope = #{scope}</if>
<if test="registCapi != null "> and regist_capi = #{registCapi}</if>
<if test="scopeType != null and scopeType != '' "> and scope_type = #{scopeType}</if>
<if test="department != null and department != '' "> and department = #{department}</if>
<if test="creditLevel != null and creditLevel != '' "> and credit_level = #{creditLevel}</if>
<if test="creditScore != null "> and credit_score = #{creditScore}</if>
<if test="createTime != null "> and create_time = #{createTime}</if>
<if test="updateTime != null "> and update_time = #{updateTime}</if>
<if test="delStatus != null and delStatus != '' "> and del_status = #{delStatus}</if>
</where>
</select>
<select id="selectMemberUnitById" parameterType="Long" resultMap="MemberUnitResult">
<include refid="selectMemberUnitVo"/>
where id = #{id}
</select>
<insert id="insertMemberUnit" parameterType="MemberUnit" useGeneratedKeys="true" keyProperty="id">
insert into member_unit
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="oid != null ">oid,</if>
<if test="name != null and name != '' ">name,</if>
<if test="creditNo != null and creditNo != '' ">credit_no,</if>
<if test="orgType != null and orgType != '' ">org_type,</if>
<if test="status != null and status != '' ">status,</if>
<if test="operName != null and operName != '' ">oper_name,</if>
<if test="regAddress != null and regAddress != '' ">reg_address,</if>
<if test="startDate != null and startDate != '' ">start_date,</if>
<if test="scope != null and scope != '' ">scope,</if>
<if test="registCapi != null ">regist_capi,</if>
<if test="scopeType != null and scopeType != '' ">scope_type,</if>
<if test="department != null and department != '' ">department,</if>
<if test="creditLevel != null and creditLevel != '' ">credit_level,</if>
<if test="creditScore != null ">credit_score,</if>
<if test="createTime != null ">create_time,</if>
<if test="updateTime != null ">update_time,</if>
<if test="delStatus != null and delStatus != '' ">del_status,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="oid != null ">#{oid},</if>
<if test="name != null and name != '' ">#{name},</if>
<if test="creditNo != null and creditNo != '' ">#{creditNo},</if>
<if test="orgType != null and orgType != '' ">#{orgType},</if>
<if test="status != null and status != '' ">#{status},</if>
<if test="operName != null and operName != '' ">#{operName},</if>
<if test="regAddress != null and regAddress != '' ">#{regAddress},</if>
<if test="startDate != null and startDate != '' ">#{startDate},</if>
<if test="scope != null and scope != '' ">#{scope},</if>
<if test="registCapi != null ">#{registCapi},</if>
<if test="scopeType != null and scopeType != '' ">#{scopeType},</if>
<if test="department != null and department != '' ">#{department},</if>
<if test="creditLevel != null and creditLevel != '' ">#{creditLevel},</if>
<if test="creditScore != null ">#{creditScore},</if>
<if test="createTime != null ">#{createTime},</if>
<if test="updateTime != null ">#{updateTime},</if>
<if test="delStatus != null and delStatus != '' ">#{delStatus},</if>
</trim>
</insert>
<update id="updateMemberUnit" parameterType="MemberUnit">
update member_unit
<trim prefix="SET" suffixOverrides=",">
<if test="oid != null ">oid = #{oid},</if>
<if test="name != null and name != '' ">name = #{name},</if>
<if test="creditNo != null and creditNo != '' ">credit_no = #{creditNo},</if>
<if test="orgType != null and orgType != '' ">org_type = #{orgType},</if>
<if test="status != null and status != '' ">status = #{status},</if>
<if test="operName != null and operName != '' ">oper_name = #{operName},</if>
<if test="regAddress != null and regAddress != '' ">reg_address = #{regAddress},</if>
<if test="startDate != null and startDate != '' ">start_date = #{startDate},</if>
<if test="scope != null and scope != '' ">scope = #{scope},</if>
<if test="registCapi != null ">regist_capi = #{registCapi},</if>
<if test="scopeType != null and scopeType != '' ">scope_type = #{scopeType},</if>
<if test="department != null and department != '' ">department = #{department},</if>
<if test="creditLevel != null and creditLevel != '' ">credit_level = #{creditLevel},</if>
<if test="creditScore != null ">credit_score = #{creditScore},</if>
<if test="createTime != null ">create_time = #{createTime},</if>
<if test="updateTime != null ">update_time = #{updateTime},</if>
<if test="delStatus != null and delStatus != '' ">del_status = #{delStatus},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteMemberUnitById" parameterType="Long">
delete from member_unit where id = #{id}
</delete>
<delete id="deleteMemberUnitByIds" parameterType="String">
delete from member_unit where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>