WeappVersionInfoMapper.xml 4.99 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.WeappVersionInfoMapper">
  <resultMap id="BaseResultMap" type="cn.com.glsx.dj.wechat.model.WeappVersionInfo">
    <id column="ID" jdbcType="INTEGER" property="id" />
    <result column="MERCHANT_ID" jdbcType="INTEGER" property="merchantId" />
    <result column="APP_ID" jdbcType="VARCHAR" property="appId" />
    <result column="ONLINE_VERSION" jdbcType="VARCHAR" property="onlineVersion" />
    <result column="ONLINE_VERSION_INFO" jdbcType="VARCHAR" property="onlineVersionInfo" />
    <result column="ONLINE_VERSION_TIME" jdbcType="TIMESTAMP" property="onlineVersionTime" />
    <result column="AUDIT_VERSION" jdbcType="VARCHAR" property="auditVersion" />
    <result column="AUDIT_VERSION_INFO" jdbcType="VARCHAR" property="auditVersionInfo" />
    <result column="AUDIT_VERSION_TIME" jdbcType="TIMESTAMP" property="auditVersionTime" />
    <result column="TEST_VERSION" jdbcType="VARCHAR" property="testVersion" />
    <result column="TEST_VERSION_INFO" jdbcType="VARCHAR" property="testVersionInfo" />
    <result column="TEST_VERSION_TIME" jdbcType="TIMESTAMP" property="testVersionTime" />
    <result column="CURRENT_VERSION" jdbcType="VARCHAR" property="currentVersion" />
    <result column="CURRENT_VERSION_INFO" jdbcType="VARCHAR" property="currentVersionInfo" />
    <result column="CURRENT_VERSION_TIME" jdbcType="TIMESTAMP" property="currentVersionTime" />
    <result column="TEST_VERSION_QRCODE" jdbcType="VARCHAR" property="testVersionQrcode" />
    <result column="APP_STATUS" jdbcType="SMALLINT" property="appStatus" />
    <result column="AUDIT_ID" jdbcType="INTEGER" property="auditId" />
    <result column="FAIL_REASON" jdbcType="VARCHAR" property="failReason" />
    <result column="REMARK" jdbcType="VARCHAR" property="remark" />
    <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, MERCHANT_ID, APP_ID, ONLINE_VERSION, ONLINE_VERSION_INFO, ONLINE_VERSION_TIME, 
    AUDIT_VERSION, AUDIT_VERSION_INFO, AUDIT_VERSION_TIME, TEST_VERSION, TEST_VERSION_INFO, 
    TEST_VERSION_TIME, CURRENT_VERSION, CURRENT_VERSION_INFO, CURRENT_VERSION_TIME,  
    TEST_VERSION_QRCODE, APP_STATUS, AUDIT_ID, FAIL_REASON, REMARK, 
    CREATED_BY, CREATED_DATE, UPDATED_BY, UPDATED_DATE, DELETED_FLAG
  </sql>
  
  <select id="search" parameterType="cn.com.glsx.dj.wechat.dto.WeappVersionInfoDTO" resultType="cn.com.glsx.dj.wechat.dto.WeappVersionInfoDTO">
  	select 
  		wvi.ID id, 
  		wvi.MERCHANT_ID merchantId, 
  		wvi.APP_ID appId, 
  		wvi.ONLINE_VERSION onlineVersion, 
  		wvi.ONLINE_VERSION_INFO onlineVersionInfo, 
  		wvi.ONLINE_VERSION_TIME onlineVersionTime, 
    	wvi.AUDIT_VERSION auditVersion, 
    	wvi.AUDIT_VERSION_INFO auditVersionInfo, 
    	wvi.AUDIT_VERSION_TIME auditVersionTime, 
    	wvi.TEST_VERSION testVersion, 
    	wvi.TEST_VERSION_INFO testVersionInfo, 
    	wvi.TEST_VERSION_TIME testVersionTime, 
    	wvi.CURRENT_VERSION currentVersion, 
    	wvi.CURRENT_VERSION_INFO currentVersionInfo, 
    	wvi.CURRENT_VERSION_TIME currentVersionTime,
    	wvi.TEST_VERSION_QRCODE testVersionQrcode, 
    	wvi.APP_STATUS appStatus, 
    	wvi.AUDIT_ID auditId, 
    	wvi.FAIL_REASON failReason, 
    	wvi.REMARK remark, 
    	wvi.CREATED_BY createdBy, 
    	wvi.CREATED_DATE createdDate, 
    	wvi.UPDATED_BY updatedBy, 
    	wvi.UPDATED_DATE updatedDate, 
    	wvi.DELETED_FLAG deletedFlag,
    	sm.merchant_name merchantName,
    	wbi.NICKNAME weappNickname,
    	wbi.HEAD_IMAGE_URL weappLogo
  	from
  		dj_weapp_version_info wvi 
  	left join
  		dj_system_merchant sm 
  	on wvi.merchant_id = sm.merchant_id
  	left join
  		dj_weapp_base_info wbi
  	on wvi.merchant_id = wbi.merchant_id
  	<where>
  		<if test="merchantId != null">
  			wvi.merchant_id = #{merchantId}
  		</if>
  		<if test="merchantName != null">
  			and sm.merchant_name like concat('%', #{merchantName}, '%')
  		</if>
  		<if test="appId != null">
  			and wvi.app_id like concat('%', #{appId}, '%')
  		</if>
  		<if test="currentVersion != null">
  			and wvi.current_version = #{currentVersion}
  		</if>
  		<if test="currentVersionInfo != null">
  			and wvi.current_version_info = #{currentVersionInfo}
  		</if>
  		<if test="appStatus != null">
  			and wvi.app_status = #{appStatus}
  		</if>
  		<if test="beginDate != null">
	  		<![CDATA[
	  			and wvi.UPDATED_DATE >= DATE_FORMAT(#{beginDate}, '%Y-%m-%d 00:00:00')
	  		]]>
  		</if>
  		<if test="endDate != null">
  			<![CDATA[
  				and wvi.UPDATED_DATE <= DATE_FORMAT(#{endDate}, '%Y-%m-%d 23:59:59')
  			]]>
  		</if>
  	</where>
  </select>
</mapper>