DomainCostDataMapper.xml 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="cn.com.countrygarden.bi.main.dao.domainname.DomainnameMapper">
  4. <resultMap id="BaseResultMap" type="cn.com.countrygarden.bi.main.model.domainname.DomainName">
  5. </resultMap>
  6. <!--
  7. WARNING - @mbg.generated
  8. -->
  9. <select id="checkIsDomainAdmin" parameterType="java.lang.String" resultType="java.lang.Integer">
  10. SELECT count(id) AS c
  11. FROM user_roles
  12. WHERE user_code = #{userCode}
  13. AND role_code = 'domain_admin'
  14. </select>
  15. <!--序号 域名 域名券号 所有人 审核状态 域名申请日期 账户ID 操作-->
  16. <select id="getDomainnameList"
  17. resultMap="BaseResultMap">
  18. SELECT
  19. DISTINCT
  20. dm.`domain_id`,
  21. dm.`domain_name`,
  22. dm.`domain_coupon`,
  23. dm. `owner`,
  24. dm.`audit_status`,
  25. dm.`apply_date`,
  26. dm.`register_user`
  27. FROM
  28. domain_manager AS dm
  29. <where>
  30. 1=1
  31. <!--choose-->
  32. <!--0-待审核 1-审核通过 2-审核未通过 3-草稿'-->
  33. <if test="userCode != null and userCode != ''">
  34. <!--是管理员而非审核员
  35. 管理员可查看:本人草稿状态的域名信息, 和有效状态的全部状态的域名信息。
  36. (usercode=登记人and audit_status=3 or (所有人的and audit_status!=3 ))-->
  37. and ((dm.register_user = #{userCode}
  38. and dm.audit_status=3) )or dm.audit_status!=3
  39. <!--and dm.audit_status!=3-->
  40. </if>
  41. <!-- <if test="userCode is null or userCode = ''">-->
  42. <!-- &lt;!&ndash;是审核员而非管理员,可查看所有已发布、待审核数据-->
  43. <!-- &ndash;&gt;-->
  44. <!-- and dm.audit_status in (0,1)-->
  45. <!-- </if>-->
  46. <if test="userCode ==null or userCode=''">
  47. and dm.audit_status in (0,1)
  48. </if>
  49. <!-- <otherwise>-->
  50. <!-- </otherwise>-->
  51. <!-- </choose>-->
  52. <!--域名(模糊匹配) 域名券号(模糊匹配) 所有人(模糊匹配) 审核状态(下拉) 域名申请日期(区间)-->
  53. <if test="domainName.domain_name != null and domainName.domain_name != ''">
  54. and dm.domain_name like CONCAT('%',#{domainName.domain_name},'%')
  55. </if>
  56. <if test="domainName.domain_coupon != null and domainName.domain_coupon != ''">
  57. and dm.domain_coupon like CONCAT('%',#{domainName.domain_coupon},'%')
  58. </if>
  59. <if test="domainName.owner != null and domainName.owner != ''">
  60. and dm.owner like CONCAT('%',#{domainName.owner},'%')
  61. </if>
  62. <if test="domainName.audit_status != null and domainName.audit_status != ''">
  63. and dm.audit_status = #{domainName.audit_status}
  64. </if>
  65. <if test="timeMap.beginDate!=null and timeMap.beginDate!= ''">
  66. <![CDATA[
  67. and dm.apply_date >= #{timeMap.beginDate}
  68. ]]>
  69. </if>
  70. <if test="timeMap.endDate!=null and timeMap.endDate!= ''">
  71. <![CDATA[
  72. and dm.apply_date <= #{timeMap.endDate}
  73. ]]>
  74. </if>
  75. </where>
  76. ORDER BY
  77. dm.audit_status,
  78. dm.apply_date DESC
  79. </select>
  80. </mapper>