RopAppServiceMapper.xml 2.54 KB
<?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>