AttMeetingInfoDao.xml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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.goldenwater.dcproj.dao.AttMeetingInfoDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.AttMeetingInfo" id="attMeetingInfoResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="title" column="TITLE"/>
  7. <result property="content" column="CONTENT"/>
  8. <result property="tm" column="TM"/>
  9. <result property="address" column="ADDRESS"/>
  10. <result property="note" column="NOTE"/>
  11. <result property="fileUrls" column="FILE_URLS"/>
  12. <result property="intm" column="INTM"/>
  13. <result property="dataStat" column="DATA_STAT"/>
  14. </resultMap>
  15. <sql id="table_columns">
  16. ID,
  17. TITLE,
  18. CONTENT,
  19. TM,
  20. ADDRESS,
  21. NOTE,
  22. FILE_URLS,
  23. INTM,DATA_STAT
  24. </sql>
  25. <sql id="entity_properties">
  26. #{id},
  27. #{title},
  28. #{content},
  29. #{tm},
  30. #{address},
  31. #{note},
  32. #{fileUrls},
  33. #{intm},#{dataStat}
  34. </sql>
  35. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  36. <sql id="page_where">
  37. <trim prefix="where" prefixOverrides="and | or ">
  38. <if test="title != null and title != ''">and TITLE = #{title}</if>
  39. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  40. <if test="content != null and content != ''">and CONTENT = #{content}</if>
  41. <if test="tm != null and tm != ''">and TM = #{tm}</if>
  42. <if test="address != null and address != ''">and ADDRESS = #{address}</if>
  43. <if test="note != null and note != ''">and NOTE = #{note}</if>
  44. <if test="fileUrls != null and fileUrls != ''">and FILE_URLS = #{fileUrls}</if>
  45. <if test="intm != null">and INTM = #{intm}</if>
  46. </trim>
  47. </sql>
  48. <select id="get" resultMap="attMeetingInfoResultMap" parameterType="String">
  49. select
  50. <include refid="table_columns"/>
  51. from ATT_MEETING_INFO where ID = #{id}
  52. </select>
  53. <select id="getBy" resultMap="attMeetingInfoResultMap">
  54. select
  55. <include refid="table_columns"/>
  56. from ATT_MEETING_INFO
  57. <include refid="page_where"/>
  58. </select>
  59. <select id="findNearInfo" resultMap="attMeetingInfoResultMap">
  60. select
  61. <include refid="table_columns"/>
  62. from ATT_MEETING_INFO o where o.intm = (
  63. select max(intm) from ATT_MEETING_INFO o where o.Data_stat=1
  64. )
  65. </select>
  66. <select id="findAll" resultMap="attMeetingInfoResultMap">
  67. select
  68. <include refid="table_columns"/>
  69. from ATT_MEETING_INFO
  70. </select>
  71. <select id="findList" resultMap="attMeetingInfoResultMap">
  72. select
  73. <include refid="table_columns"/>
  74. from ATT_MEETING_INFO
  75. <include refid="page_where"/>
  76. </select>
  77. <select id="selectCount" resultType="int">
  78. select count(ID) from ATT_MEETING_INFO
  79. <include refid="page_where"/>
  80. </select>
  81. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttMeetingInfo">
  82. insert into ATT_MEETING_INFO(
  83. <include refid="table_columns"/>
  84. )
  85. values (
  86. <include refid="entity_properties"/>
  87. )
  88. </insert>
  89. <delete id="delete" parameterType="java.lang.String">
  90. delete from ATT_MEETING_INFO where ID = #{id}
  91. </delete>
  92. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttMeetingInfo">
  93. delete from ATT_MEETING_INFO
  94. <include refid="page_where"/>
  95. </delete>
  96. <update id="deleteInFlag" parameterType="java.lang.String">
  97. update ATT_MEETING_INFO set flag_valid = 0 where ID = #{id}
  98. </update>
  99. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttMeetingInfo">
  100. update ATT_MEETING_INFO
  101. <trim prefix="set" suffixOverrides=",">
  102. <if test="title != null and title != ''">TITLE = #{title},</if>
  103. <if test="content != null and content != ''">CONTENT = #{content},</if>
  104. <if test="tm != null and tm != ''">TM = #{tm},</if>
  105. <if test="address != null and address != ''">ADDRESS = #{address},</if>
  106. <if test="note != null and note != ''">NOTE = #{note},</if>
  107. <if test="fileUrls != null and fileUrls != ''">FILE_URLS = #{fileUrls},</if>
  108. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  109. <if test="intm != null">INTM = #{intm},</if>
  110. </trim>
  111. <where>ID = #{id}</where>
  112. </update>
  113. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttMeetingInfo">
  114. update ATT_MEETING_INFO
  115. <trim prefix="set" suffixOverrides=",">
  116. <if test="title != null and title != ''">TITLE = #{title},</if>
  117. <if test="content != null and content != ''">CONTENT = #{content},</if>
  118. <if test="tm != null and tm != ''">TM = #{tm},</if>
  119. <if test="address != null and address != ''">ADDRESS = #{address},</if>
  120. <if test="note != null and note != ''">NOTE = #{note},</if>
  121. <if test="fileUrls != null and fileUrls != ''">FILE_URLS = #{fileUrls},</if>
  122. <if test="intm != null">INTM = #{intm},</if>
  123. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  124. </trim>
  125. <include refid="page_where"/>
  126. </update>
  127. <!-- 其他自定义SQL -->
  128. </mapper>