WeappNicknameModifyAuditMapper.xml 2.89 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.wechat.mapper.WeappNicknameModifyAuditMapper">
  <resultMap id="BaseResultMap" type="cn.com.glsx.dj.wechat.model.WeappNicknameModifyAudit">
    <id column="ID" jdbcType="INTEGER" property="id" />
    <result column="APP_ID" jdbcType="VARCHAR" property="appId" />
    <result column="NICKNAME" jdbcType="VARCHAR" property="nickname" />
    <result column="AUDIT_ID" jdbcType="INTEGER" property="auditId" />
    <result column="AUDIT_STAT" jdbcType="INTEGER" property="auditStat" />
    <result column="FAIL_REASON" jdbcType="VARCHAR" property="failReason" />
    <result column="CREATED_BY" jdbcType="VARCHAR" property="createdBy" />
    <result column="CREATED_DATE" jdbcType="TIMESTAMP" property="createdDate" />
    <result column="UPDATED_BY" jdbcType="VARCHAR" property="updatedBy" />
    <result column="UPDATED_DATE" jdbcType="TIMESTAMP" property="updatedDate" />
    <result column="DELETED_FLAG" jdbcType="CHAR" property="deletedFlag" />
  </resultMap>
  <sql id="Base_Column_List">
    ID, APP_ID, NICKNAME, AUDIT_ID, AUDIT_STAT, FAIL_REASON, CREATED_BY, CREATED_DATE, UPDATED_BY, UPDATED_DATE, DELETED_FLAG
  </sql>
  
  <select id="loadByAppIdLast" parameterType="java.lang.String" resultMap="BaseResultMap">
  	select
  	<include refid="Base_Column_List"></include>
  	from dj_weapp_nickname_modify_audit
  	where APP_ID = #{appId}
  	order by ID desc
  	limit 1
  </select>
  
  <select id="search" parameterType="cn.com.glsx.dj.wechat.dto.WeappNicknameModifyAuditDTO" resultType="cn.com.glsx.dj.wechat.dto.WeappNicknameModifyAuditDTO">
  	select 
  		wnma.ID id,
  		wnma.APP_ID appId,  
  		wnma.NICKNAME nickname,
    	wbi.HEAD_IMAGE_URL logo,
    	sm.MERCHANT_ID merchantId, 
    	sm.merchant_name merchantName,
    	wnma.AUDIT_ID auditId, 
    	wnma.AUDIT_STAT auditStat,
    	wnma.FAIL_REASON failReason, 
    	wnma.CREATED_BY createdBy, 
    	wnma.CREATED_DATE createdDate, 
    	wnma.UPDATED_BY updatedBy, 
    	wnma.UPDATED_DATE updatedDate, 
    	wnma.DELETED_FLAG deletedFlag
  	from
  		dj_weapp_nickname_modify_audit wnma 
  	left join
  		dj_weapp_base_info wbi
  	on wnma.app_id = wbi.app_id
  	left join
  		dj_system_merchant sm 
  	on wbi.merchant_id = sm.merchant_id
  	<where>
  		wnma.DELETED_FLAG = 'N'
  		<if test="merchantId != null">
  			and sm.merchant_id = #{merchantId}
  		</if>
  		<if test="merchantName != null">
  			and sm.merchant_name like concat('%', #{merchantName}, '%')
  		</if>
  		<if test="appId != null">
  			and wnma.app_id like concat('%', #{appId}, '%')
  		</if>
  		<if test="nickname != null">
  			and wnma.NICKNAME like concat('%', #{nickname}, '%')
  		</if>
  		<if test="auditStat != null">
  			and wnma.audit_stat = #{auditStat}
  		</if>
  	</where>
  	order by wnma.id desc
  </select>
  
</mapper>