CompanyShortMapper.xml
1.52 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
<?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.lframework.xingyun.basedata.mappers.CompanyShortMapper">
<resultMap id="CompanyShort" type="com.lframework.xingyun.basedata.entity.CompanyShort">
<id column="id" property="id"/>
<result column="company_name" property="companyName"/>
<result column="short_name" property="shortName"/>
<result column="create_by_id" property="createById"/>
<result column="update_by_id" property="updateById"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>
<sql id="CompanyShortSql">
SELECT
tb.id,
tb.company_name,
tb.short_name,
tb.create_by_id,
tb.update_by_id,
tb.create_time,
tb.update_time
FROM base_data_company_short tb
</sql>
<select id="query" resultMap="CompanyShort">
<include refid="CompanyShortSql"/>
<where>
<if test="vo.companyName != null and vo.companyName != ''">
AND tb.company_name LIKE CONCAT('%', #{vo.companyName}, '%')
</if>
<if test="vo.shortName != null and vo.shortName != ''">
AND tb.short_name LIKE CONCAT('%', #{vo.shortName}, '%')
</if>
</where>
ORDER BY tb.create_time DESC, tb.id DESC
</select>
</mapper>