ActivityMapperExt.xml 2.4 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="com.goafanti.common.dao.ActivityMapper">
  4. <select id="findActivityListByPage" parameterType="String" resultType="com.goafanti.activity.bo.ActivityListBo">
  5. select
  6. id,
  7. start_time as startTime,
  8. end_time as endTime,
  9. name,
  10. host,
  11. type,
  12. form,
  13. enroll_deadline as enrollDeadline
  14. from activity
  15. where 1=1
  16. <if test="sTime != null">
  17. and start_time <![CDATA[ >= ]]> #{sTime,jdbcType=TIMESTAMP}
  18. </if>
  19. <if test="eTime != null">
  20. and start_time <![CDATA[ < ]]> #{eTime,jdbcType=TIMESTAMP}
  21. </if>
  22. <if test="name != null">
  23. and name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  24. </if>
  25. <if test="host != null">
  26. and host like CONCAT('%',#{host,jdbcType=VARCHAR},'%')
  27. </if>
  28. <if test="type != null">
  29. and type = #{type,jdbcType=INTEGER}
  30. </if>
  31. <if test="form != null">
  32. and form = #{form,jdbcType=INTEGER}
  33. </if>
  34. order by start_time desc
  35. <if test="page_sql!=null">
  36. ${page_sql}
  37. </if>
  38. </select>
  39. <select id="findActivityCount" parameterType="String" resultType="java.lang.Integer">
  40. select
  41. count(1)
  42. from activity
  43. where 1=1
  44. <if test="sTime != null">
  45. and start_time <![CDATA[ >= ]]> #{sTime,jdbcType=TIMESTAMP}
  46. </if>
  47. <if test="eTime != null">
  48. and start_time <![CDATA[ < ]]> #{eTime,jdbcType=TIMESTAMP}
  49. </if>
  50. <if test="name != null">
  51. and name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  52. </if>
  53. <if test="host != null">
  54. and host like CONCAT('%',#{host,jdbcType=VARCHAR},'%')
  55. </if>
  56. <if test="type != null">
  57. and type = #{type,jdbcType=INTEGER}
  58. </if>
  59. <if test="form != null">
  60. and form = #{form,jdbcType=INTEGER}
  61. </if>
  62. </select>
  63. <delete id="batchDeleteByPrimaryKey" parameterType="java.util.List">
  64. delete
  65. from activity
  66. where id in
  67. <foreach item="item" index="index" collection="list" open="("
  68. separator="," close=")">
  69. #{item}
  70. </foreach>
  71. </delete>
  72. <select id="findPortalList" resultMap="BaseResultMap">
  73. select
  74. <include refid="Base_Column_List" />
  75. from activity
  76. where 1=1
  77. <if test="form != null">
  78. and form = #{form,jdbcType=INTEGER}
  79. </if>
  80. order by start_time desc
  81. limit #{pageNo,jdbcType=INTEGER}, #{pageSize,jdbcType=INTEGER}
  82. </select>
  83. </mapper>