1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- <?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.abi.qms.platform.dao.mapper.BaseActiveMapper">
- <!-- 通用查询映射结果 -->
- <resultMap id="BaseResultMap" type="com.abi.qms.platform.dao.entity.BaseActive">
- <id column="id" property="id" />
- <result column="active_code" property="activeCode" />
- <result column="active_name" property="activeName" />
- <result column="active_type" property="activeType" />
- <result column="audit_status" property="auditStatus" />
- <result column="apply_time" property="applyTime" />
- <result column="apply_user_id" property="applyUserId" />
- <result column="apply_user_name" property="applyUserName" />
- <result column="audit_user_id" property="auditUserId" />
- <result column="audit_user_name" property="auditUserName" />
- <result column="begin_time" property="beginTime" />
- <result column="end_time" property="endTime" />
- <result column="brand_code" property="brandCode" />
- <result column="sub_brand_code" property="subBrandCode" />
- <result column="url_tab" property="urlTab" />
- <result column="active_url" property="activeUrl" />
- <result column="create_time" property="createTime" />
- <result column="create_by" property="createBy" />
- <result column="update_time" property="updateTime" />
- <result column="update_by" property="updateBy" />
- <result column="is_delete" property="isDelete" />
- <result column="valid" property="valid" />
- <result column="is_modify_apply" property="isModifyApply" />
- </resultMap>
- <!-- 通用查询结果列 -->
- <sql id="Base_Column_List">
- id, active_code, active_name, active_type, audit_status, apply_time, apply_user_id, apply_user_name, audit_user_id, audit_user_name, begin_time, end_time, brand_code, sub_brand_code, url_tab, active_url, create_time, create_by, update_time, update_by, is_delete, valid, is_modify_apply
- </sql>
- <select id="listActivePage" resultType="com.abi.qms.platform.dao.vo.result.ListActiveVO">
- select active.id, active.active_name, active.active_type, active.audit_status, active.apply_time, active.apply_user_name, active.begin_time, active.end_time, active.active_url, active.valid, active.is_modify_apply, apply.audit_status as apply_audit_status
- from base_active active
- left join base_active_modify_apply apply on active.id = apply.active_id and apply.is_delete = 0
- <where>
- active.is_delete = 0
- <if test="param.activeName != null and param.activeName != ''">
- AND active.active_name like concat('%',#{param.activeName},'%')
- </if>
- <if test="param.activeType != null">
- AND active.active_type = #{param.activeType}
- </if>
- <if test="param.auditStatus != null ">
- AND active.audit_status = #{param.auditStatus}
- </if>
- <if test="param.valid != null ">
- AND active.valid = #{param.valid}
- </if>
- </where>
- order by active.apply_time
- </select>
- <select id="getPackageActive" resultType="com.abi.qms.platform.dao.vo.result.PackageActiveVO">
- SELECT
- ba.id,
- ba.active_code,
- ba.active_name,
- ba.active_url,
- ba.active_type,
- ba.begin_time,
- ba.end_time,
- ba.brand_code
- FROM
- base_active ba
- LEFT JOIN base_active_qr_package_mapping bam ON ba.id = bam.active_id
- WHERE
- bam.qr_package_id = #{packageId} limit 1
- </select>
- </mapper>
|