db2aaec5414bb0d31b913fd8ef1862e9dfc67cdd.svn-base 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  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.MeetScheInfoDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.MeetScheInfo" id="meetScheInfoResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="meetId" column="MEET_ID"/>
  7. <result property="title" column="TITLE"/>
  8. <result property="content" column="CONTENT"/>
  9. <result property="location" column="LOCATION"/>
  10. <result property="stTm" column="ST_TM"/>
  11. <result property="enTm" column="EN_TM"/>
  12. <result property="gdX" column="GD_X"/>
  13. <result property="gdY" column="GD_Y"/>
  14. <result property="type" column="TYPE"/>
  15. <result property="compere" column="COMPERE"/>
  16. <result property="keySpeaker" column="KEY_SPEAKER"/>
  17. <result property="intm" column="INTM"/>
  18. </resultMap>
  19. <sql id="table_columns">
  20. ID,
  21. MEET_ID,
  22. TITLE,
  23. CONTENT,
  24. LOCATION,
  25. ST_TM,
  26. EN_TM,
  27. GD_X,
  28. GD_Y,
  29. TYPE,
  30. COMPERE,
  31. KEY_SPEAKER,
  32. INTM
  33. </sql>
  34. <sql id="entity_properties">
  35. #{id},
  36. #{meetId},
  37. #{title},
  38. #{content},
  39. #{location},
  40. #{stTm},
  41. #{enTm},
  42. #{gdX},
  43. #{gdY},
  44. #{type},
  45. #{compere},
  46. #{keySpeaker},
  47. #{intm}
  48. </sql>
  49. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  50. <sql id="page_where">
  51. <trim prefix="where" prefixOverrides="and | or ">
  52. <if test="meetId != null and meetId != ''">and MEET_ID = #{meetId}</if>
  53. <if test="title != null and title != ''">and TITLE = #{title}</if>
  54. <if test="content != null and content != ''">and CONTENT = #{content}</if>
  55. <if test="location != null and location != ''">and LOCATION = #{location}</if>
  56. <if test="stTm != null">and ST_TM = #{stTm}</if>
  57. <if test="enTm != null">and EN_TM = #{enTm}</if>
  58. <if test="gdX != null and gdX != ''">and GD_X = #{gdX}</if>
  59. <if test="gdY != null and gdY != ''">and GD_Y = #{gdY}</if>
  60. <if test="type != null and type != ''">and TYPE = #{type}</if>
  61. <if test="compere != null and compere != ''">and COMPERE = #{compere}</if>
  62. <if test="keySpeaker != null and keySpeaker != ''">and KEY_SPEAKER = #{keySpeaker}</if>
  63. <if test="intm != null">and INTM = #{intm}</if>
  64. </trim>
  65. </sql>
  66. <select id="get" resultMap="meetScheInfoResultMap" parameterType="String" >
  67. select <include refid="table_columns" /> from MEET_SCHE_INFO where ID = #{id}
  68. </select>
  69. <select id="getBy" resultMap="meetScheInfoResultMap">
  70. select <include refid="table_columns" /> from MEET_SCHE_INFO <include refid="page_where" />
  71. </select>
  72. <select id="findAll" resultMap="meetScheInfoResultMap">
  73. select <include refid="table_columns" /> from MEET_SCHE_INFO
  74. </select>
  75. <select id="findList" resultMap="meetScheInfoResultMap">
  76. select <include refid="table_columns" /> from MEET_SCHE_INFO <include refid="page_where" />
  77. </select>
  78. <select id="selectCount" resultType="int" >
  79. select count(ID) from MEET_SCHE_INFO <include refid="page_where" />
  80. </select>
  81. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.MeetScheInfo">
  82. insert into MEET_SCHE_INFO( <include refid="table_columns" /> )
  83. values ( <include refid="entity_properties" /> )
  84. </insert>
  85. <delete id="delete" parameterType="java.lang.String">
  86. delete from MEET_SCHE_INFO where ID = #{id}
  87. </delete>
  88. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.MeetScheInfo">
  89. delete from MEET_SCHE_INFO <include refid="page_where" />
  90. </delete>
  91. <update id="deleteInFlag" parameterType="java.lang.String">
  92. update MEET_SCHE_INFO set flag_valid = 0 where ID = #{id}
  93. </update>
  94. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.MeetScheInfo">
  95. update MEET_SCHE_INFO
  96. <trim prefix="set" suffixOverrides=",">
  97. <if test="meetId != null and meetId != ''">MEET_ID = #{meetId},</if>
  98. <if test="title != null and title != ''">TITLE = #{title},</if>
  99. <if test="content != null and content != ''">CONTENT = #{content},</if>
  100. <if test="location != null and location != ''">LOCATION = #{location},</if>
  101. <if test="stTm != null">ST_TM = #{stTm},</if>
  102. <if test="enTm != null">EN_TM = #{enTm},</if>
  103. <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
  104. <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
  105. <if test="type != null and type != ''">TYPE = #{type},</if>
  106. <if test="compere != null and compere != ''">COMPERE = #{compere},</if>
  107. <if test="keySpeaker != null and keySpeaker != ''">KEY_SPEAKER = #{keySpeaker},</if>
  108. <if test="intm != null">INTM = #{intm},</if>
  109. </trim>
  110. <where>ID = #{id}</where>
  111. </update>
  112. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.MeetScheInfo">
  113. update MEET_SCHE_INFO
  114. <trim prefix="set" suffixOverrides=",">
  115. <if test="meetId != null and meetId != ''">MEET_ID = #{meetId},</if>
  116. <if test="title != null and title != ''">TITLE = #{title},</if>
  117. <if test="content != null and content != ''">CONTENT = #{content},</if>
  118. <if test="location != null and location != ''">LOCATION = #{location},</if>
  119. <if test="stTm != null">ST_TM = #{stTm},</if>
  120. <if test="enTm != null">EN_TM = #{enTm},</if>
  121. <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
  122. <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
  123. <if test="type != null and type != ''">TYPE = #{type},</if>
  124. <if test="compere != null and compere != ''">COMPERE = #{compere},</if>
  125. <if test="keySpeaker != null and keySpeaker != ''">KEY_SPEAKER = #{keySpeaker},</if>
  126. <if test="intm != null">INTM = #{intm},</if>
  127. </trim>
  128. <include refid="page_where" />
  129. </update>
  130. <!-- 其他自定义SQL -->
  131. <select id="getScheInfoList" parameterType="cn.com.goldenwater.dcproj.param.MeetScheInfoParam" resultMap="meetScheInfoResultMap">
  132. SELECT T.ID,
  133. T.MEET_ID,
  134. T.TITLE,
  135. T.CONTENT,
  136. T.LOCATION,
  137. T.ST_TM,
  138. T.EN_TM,
  139. T.GD_X,
  140. T.GD_Y,
  141. T.TYPE,
  142. T.COMPERE,
  143. T.KEY_SPEAKER,
  144. T.INTM FROM MEET_SCHE_INFO T
  145. WHERE T.MEET_ID = #{meetId}
  146. <if test="type != null and type != ''">
  147. AND T.type = #{type}
  148. </if>
  149. ORDER BY T.ST_TM
  150. </select>
  151. </mapper>