TdBApiLogSMapper.xml 2.16 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="com.zteits.pay.mapper.smapper.TdBApiLogSMapper">
  <resultMap id="BaseResultMap" type="com.zteits.pay.domain.TdBApiLogName">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="code" jdbcType="VARCHAR" property="code" />
    <result column="path" jdbcType="VARCHAR" property="path" />
    <result column="user_id" jdbcType="VARCHAR" property="userId" />
    <result column="user_phone" jdbcType="VARCHAR" property="userPhone" />
    <result column="api_type" jdbcType="INTEGER" property="apiType" />
    <result column="data_state" jdbcType="INTEGER" property="dataState" />
    <result column="create_empid" jdbcType="VARCHAR" property="createEmpid" />
    <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
    <result column="modfiy_empid" jdbcType="VARCHAR" property="modfiyEmpid" />
    <result column="modfiy_date" jdbcType="TIMESTAMP" property="modfiyDate" />
    <result column="org_id" jdbcType="BIGINT" property="orgId" />
    <result column="uddi" jdbcType="VARCHAR" property="uddi" />
  </resultMap>

  <sql id="Base_Column_List">
    id, code, path, user_id, user_phone, api_type, data_state, create_empid, create_date, 
    modfiy_empid, modfiy_date, org_id
  </sql>
  <select id="pageQueryApiLogByCondition" parameterType="com.zteits.clouds.api.dto.pay.param.ApiLogRequest" resultMap="BaseResultMap">
    select api.uddi,log.* from td_b_api_log log left join td_b_api api on log.code = api.code and api.data_state = 1
    where log.data_state = 1
    <if test="orgId != null">
        and log.org_id = #{orgId}
    </if>
    <if test="code != null">
      and log.code = #{code}
    </if>
    <if test="userIdOrName != null">
      and (log.user_id like concat('%',#{userIdOrName},'%') or log.user_phone  like concat('%',#{userIdOrName},'%')  )
    </if>
    <if test="beginDate != null">
      and log.create_date >= #{beginDate}
    </if>
    <if test="endDate != null">
      AND log.create_date &lt;= #{endDate}
    </if>
    order by log.create_date desc
  </select>
</mapper>