BaseActiveMapper.xml 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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="com.abi.qms.platform.dao.mapper.BaseActiveMapper">
  4. <!-- 通用查询映射结果 -->
  5. <resultMap id="BaseResultMap" type="com.abi.qms.platform.dao.entity.BaseActive">
  6. <id column="id" property="id" />
  7. <result column="active_code" property="activeCode" />
  8. <result column="active_name" property="activeName" />
  9. <result column="active_type" property="activeType" />
  10. <result column="audit_status" property="auditStatus" />
  11. <result column="apply_time" property="applyTime" />
  12. <result column="apply_user_id" property="applyUserId" />
  13. <result column="apply_user_name" property="applyUserName" />
  14. <result column="audit_user_id" property="auditUserId" />
  15. <result column="audit_user_name" property="auditUserName" />
  16. <result column="begin_time" property="beginTime" />
  17. <result column="end_time" property="endTime" />
  18. <result column="brand_code" property="brandCode" />
  19. <result column="sub_brand_code" property="subBrandCode" />
  20. <result column="url_tab" property="urlTab" />
  21. <result column="active_url" property="activeUrl" />
  22. <result column="create_time" property="createTime" />
  23. <result column="create_by" property="createBy" />
  24. <result column="update_time" property="updateTime" />
  25. <result column="update_by" property="updateBy" />
  26. <result column="is_delete" property="isDelete" />
  27. <result column="valid" property="valid" />
  28. <result column="is_modify_apply" property="isModifyApply" />
  29. </resultMap>
  30. <!-- 通用查询结果列 -->
  31. <sql id="Base_Column_List">
  32. 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
  33. </sql>
  34. <select id="listActivePage" resultType="com.abi.qms.platform.dao.vo.result.ListActiveVO">
  35. 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
  36. from base_active active
  37. left join base_active_modify_apply apply on active.id = apply.active_id and apply.is_delete = 0
  38. <where>
  39. active.is_delete = 0
  40. <if test="param.activeName != null and param.activeName != ''">
  41. AND active.active_name like concat('%',#{param.activeName},'%')
  42. </if>
  43. <if test="param.activeType != null">
  44. AND active.active_type = #{param.activeType}
  45. </if>
  46. <if test="param.auditStatus != null ">
  47. AND active.audit_status = #{param.auditStatus}
  48. </if>
  49. <if test="param.valid != null ">
  50. AND active.valid = #{param.valid}
  51. </if>
  52. </where>
  53. order by active.apply_time
  54. </select>
  55. <select id="getPackageActive" resultType="com.abi.qms.platform.dao.vo.result.PackageActiveVO">
  56. SELECT
  57. ba.id,
  58. ba.active_code,
  59. ba.active_name,
  60. ba.active_url,
  61. ba.active_type,
  62. ba.begin_time,
  63. ba.end_time,
  64. ba.brand_code
  65. FROM
  66. base_active ba
  67. LEFT JOIN base_active_qr_package_mapping bam ON ba.id = bam.active_id
  68. WHERE
  69. bam.qr_package_id = #{packageId} limit 1
  70. </select>
  71. </mapper>