RopAppServiceMapper.xml
2.54 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
<?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="cn.com.glsx.dj.system.mapper.RopAppServiceMapper" >
<resultMap id="BaseResultMap" type="cn.com.glsx.dj.system.model.RopAppService" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="APP_ACCESS_ID" property="appAccessId" jdbcType="INTEGER" />
<result column="SERVICE_ID" property="serviceId" jdbcType="INTEGER" />
<result column="SERVICE_VERSION" property="serviceVersion" jdbcType="VARCHAR" />
<result column="SERVICE_STATUS" property="serviceStatus" jdbcType="INTEGER" />
<result column="CALL_LIMIT" property="callLimit" jdbcType="INTEGER" />
<result column="REMARK" property="remark" jdbcType="VARCHAR" />
<result column="created_by" property="createdBy" jdbcType="VARCHAR" />
<result column="created_date" property="createdDate" jdbcType="TIMESTAMP" />
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
<result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
</resultMap>
<sql id="Base_Column_List" >
id, APP_ID, SERVICE_ID, SERVICE_VERSION, SERVICE_STATUS, CALL_LIMIT, REMARK, created_by,
created_date, updated_by, updated_date, deleted_flag
</sql>
<select id="search" parameterType="cn.com.glsx.dj.system.dto.RopAppServiceDTO" resultType="cn.com.glsx.dj.system.dto.RopAppServiceDTO">
select
ras.id id,
ras.APP_ACCESS_ID appAccessId,
ras.SERVICE_ID serviceId,
ras.SERVICE_VERSION serviceVersion,
if(rs.SERVICE_STATUS = 1, ras.SERVICE_STATUS, rs.SERVICE_STATUS) serviceStatus,
ras.CALL_LIMIT callLimit,
ras.REMARK remark,
ras.updated_date updatedDate,
rs.SERVICE_NAME serviceName,
rs.SERVICE_METHOD serviceMethod,
raa.APP_ID appId
from
dj_system_rop_app_service ras
left join
dj_system_rop_service rs
on ras.SERVICE_ID = rs.id
left join
dj_system_rop_app_access raa
on ras.APP_ACCESS_ID = raa.id
<where>
<if test="appAccessId != null">
ras.APP_ACCESS_ID = #{appAccessId}
</if>
<if test="serviceStatus != null">
and ras.SERVICE_STATUS = #{serviceStatus}
</if>
<if test="serviceName != null">
and rs.SERVICE_NAME like concat('%', #{serviceName}, '%')
</if>
<if test="serviceMethod != null">
and rs.SERVICE_METHOD like concat('%', #{serviceMethod}, '%')
</if>
</where>
</select>
</mapper>