FileRelMapper.xml
2.33 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
<?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.qgutech.qgyun.xieyunhui.mapper.FileRelMapper">
<resultMap id="fileRelMap" type="com.qgutech.qgyun.xieyunhui.model.FileRel">
<result column="id" property="id"/>
<result column="refer_id" property="referId"/>
<result column="fun_code" property="funCode"/>
<result column="field_name" property="fieldName"/>
<result column="corp_code" property="corpCode"/>
<result column="created_at" property="createdAt"/>
<result column="updated_at" property="updatedAt"/>
<result column="created_by" property="createdBy"/>
<result column="updated_by" property="updatedBy"/>
<result column="file_id" property="fileId"/>
</resultMap>
<sql id="tableName">t_auto_xieyunhui_file_rel fileRel</sql>
<sql id="condition">
<if test="con.id != null and con.id != ''">
and fileRel.id = #{con.id}
</if>
<if test="con.referId != null and con.referId != ''">
and fileRel.refer_id = #{con.referId}
</if>
<if test="con.funCode != null and con.funCode != ''">
and fileRel.fun_code = #{con.funCode}
</if>
<if test="con.fieldName != null and con.fieldName != ''">
and fileRel.field_name = #{con.fieldName}
</if>
<if test="con.corpCode != null and con.corpCode != ''">
and fileRel.corp_code = #{con.corpCode}
</if>
<if test="con.createdAt != null">
and fileRel.created_at = #{con.createdAt}
</if>
<if test="con.updatedAt != null">
and fileRel.updated_at = #{con.updatedAt}
</if>
<if test="con.createdBy != null and con.createdBy != ''">
and fileRel.created_by = #{con.createdBy}
</if>
<if test="con.updatedBy != null and con.updatedBy != ''">
and fileRel.updated_by = #{con.updatedBy}
</if>
<if test="con.fileId != null and con.fileId != ''">
and fileRel.file_id = #{con.fileId}
</if>
</sql>
<select id="search" resultMap="fileRelMap">
select fileRel.*
from <include refid="tableName"/>
WHERE 1=1 <include refid="condition"/>
order by fileRel.created_at DESC
</select>
</mapper>