1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- <?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.countrygarden.bi.main.dao.domainname.DomainnameMapper">
- <resultMap id="BaseResultMap" type="cn.com.countrygarden.bi.main.model.domainname.DomainName">
- </resultMap>
- <!--
- WARNING - @mbg.generated
- -->
- <select id="checkIsDomainAdmin" parameterType="java.lang.String" resultType="java.lang.Integer">
- SELECT count(id) AS c
- FROM user_roles
- WHERE user_code = #{userCode}
- AND role_code = 'domain_admin'
- </select>
- <!--序号 域名 域名券号 所有人 审核状态 域名申请日期 账户ID 操作-->
- <select id="getDomainnameList"
- resultMap="BaseResultMap">
- SELECT
- DISTINCT
- dm.`domain_id`,
- dm.`domain_name`,
- dm.`domain_coupon`,
- dm. `owner`,
- dm.`audit_status`,
- dm.`apply_date`,
- dm.`register_user`
- FROM
- domain_manager AS dm
- <where>
- 1=1
- <!--choose-->
- <!--0-待审核 1-审核通过 2-审核未通过 3-草稿'-->
- <if test="userCode != null and userCode != ''">
- <!--是管理员而非审核员
- 管理员可查看:本人草稿状态的域名信息, 和有效状态的全部状态的域名信息。
- (usercode=登记人and audit_status=3 or (所有人的and audit_status!=3 ))-->
- and ((dm.register_user = #{userCode}
- and dm.audit_status=3) )or dm.audit_status!=3
- <!--and dm.audit_status!=3-->
- </if>
- <!-- <if test="userCode is null or userCode = ''">-->
- <!-- <!–是审核员而非管理员,可查看所有已发布、待审核数据-->
- <!-- –>-->
- <!-- and dm.audit_status in (0,1)-->
- <!-- </if>-->
- <if test="userCode ==null or userCode=''">
- and dm.audit_status in (0,1)
- </if>
- <!-- <otherwise>-->
- <!-- </otherwise>-->
- <!-- </choose>-->
- <!--域名(模糊匹配) 域名券号(模糊匹配) 所有人(模糊匹配) 审核状态(下拉) 域名申请日期(区间)-->
- <if test="domainName.domain_name != null and domainName.domain_name != ''">
- and dm.domain_name like CONCAT('%',#{domainName.domain_name},'%')
- </if>
- <if test="domainName.domain_coupon != null and domainName.domain_coupon != ''">
- and dm.domain_coupon like CONCAT('%',#{domainName.domain_coupon},'%')
- </if>
- <if test="domainName.owner != null and domainName.owner != ''">
- and dm.owner like CONCAT('%',#{domainName.owner},'%')
- </if>
- <if test="domainName.audit_status != null and domainName.audit_status != ''">
- and dm.audit_status = #{domainName.audit_status}
- </if>
- <if test="timeMap.beginDate!=null and timeMap.beginDate!= ''">
- <![CDATA[
- and dm.apply_date >= #{timeMap.beginDate}
- ]]>
- </if>
- <if test="timeMap.endDate!=null and timeMap.endDate!= ''">
- <![CDATA[
- and dm.apply_date <= #{timeMap.endDate}
- ]]>
- </if>
- </where>
- ORDER BY
- dm.audit_status,
- dm.apply_date DESC
- </select>
- </mapper>
|