BaseActiveMapper.xml 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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="active_url" property="activeUrl" />
  21. <result column="create_time" property="createTime" />
  22. <result column="create_by" property="createBy" />
  23. <result column="update_time" property="updateTime" />
  24. <result column="update_by" property="updateBy" />
  25. <result column="is_delete" property="isDelete" />
  26. <result column="valid" property="valid" />
  27. <result column="is_modify_apply" property="isModifyApply" />
  28. </resultMap>
  29. <!-- 通用查询结果列 -->
  30. <sql id="Base_Column_List">
  31. 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, active_url, create_time, create_by, update_time, update_by, is_delete, valid, is_modify_apply
  32. </sql>
  33. <select id="listActivePage" resultType="com.abi.qms.platform.dao.vo.result.ListActiveVO">
  34. 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
  35. from base_active active
  36. left join base_active_modify_apply apply on active.id = apply.active_id and apply.is_delete = 0
  37. <where>
  38. active.is_delete = 0
  39. <if test="param.activeName != null and param.activeName != ''">
  40. AND active.active_name like concat('%',#{param.activeName},'%')
  41. </if>
  42. <if test="param.activeType != null">
  43. AND active.active_type = #{param.activeType}
  44. </if>
  45. <if test="param.auditStatus != null ">
  46. AND active.audit_status = #{param.auditStatus}
  47. </if>
  48. </where>
  49. order by active.apply_time
  50. </select>
  51. <select id="getPackageActive" resultType="com.abi.qms.platform.dao.vo.result.PackageActiveVO">
  52. SELECT
  53. ba.id,
  54. ba.active_code,
  55. ba.active_name,
  56. ba.active_url,
  57. ba.active_type,
  58. ba.begin_time,
  59. ba.end_time,
  60. ba.brand_code
  61. FROM
  62. base_active ba
  63. LEFT JOIN base_active_qr_package_mapping bam ON ba.id = bam.active_id
  64. WHERE
  65. bam.qr_package_id = #{packageId} limit 1
  66. </select>
  67. </mapper>