BisInspMeetRecodeDao.xml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  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.BisInspMeetRecodeDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspMeetRecode" id="bisInspMeetRecodeResultMap">
  5. <result property="meetingId" column="MEETING_ID"/>
  6. <result property="persName" column="PERS_NAME"/>
  7. <result property="orgNm" column="ORG_NM"/>
  8. <result property="controlPersId" column="CONTROL_PERS_ID"/>
  9. <result property="controlPersName" column="CONTROL_PERS_NAME"/>
  10. <result property="sms" column="SMS"/>
  11. <result property="id" column="ID"/>
  12. <result property="title" column="TITLE"/>
  13. <result property="startTime" column="START_TIME"/>
  14. <result property="endTime" column="END_TIME"/>
  15. <result property="participants" column="PARTICIPANTS"/>
  16. <result property="address" column="ADDRESS"/>
  17. <result property="details" column="DETAILS"/>
  18. <result property="autoinvite" column="AUTOINVITE"/>
  19. <result property="password" column="PASSWORD"/>
  20. <result property="controlPassword" column="CONTROL_PASSWORD"/>
  21. <result property="meetingroomtype" column="MEETINGROOMTYPE"/>
  22. <result property="conferencenumber" column="CONFERENCENUMBER"/>
  23. <result property="autorecord" column="AUTORECORD"/>
  24. <result property="mainimage" column="MAINIMAGE"/>
  25. <result property="enableofflinerecord" column="ENABLEOFFLINERECORD"/>
  26. <result property="enablesinglerecord" column="ENABLESINGLERECORD"/>
  27. <result property="persId" column="PERS_ID"/>
  28. <result property="orgId" column="ORG_ID"/>
  29. <result property="intm" column="INTM"/>
  30. <result property="uptm" column="UPTM"/>
  31. <result property="flagValid" column="FLAG_VALID"/>
  32. </resultMap>
  33. <sql id="table_columns">
  34. MEETING_ID,
  35. PERS_NAME,
  36. ORG_NM,
  37. CONTROL_PERS_ID,
  38. CONTROL_PERS_NAME,
  39. SMS,
  40. ID,
  41. TITLE,
  42. START_TIME,
  43. END_TIME,
  44. PARTICIPANTS,
  45. ADDRESS,
  46. DETAILS,
  47. AUTOINVITE,
  48. PASSWORD,
  49. CONTROL_PASSWORD,
  50. MEETINGROOMTYPE,
  51. CONFERENCENUMBER,
  52. AUTORECORD,
  53. MAINIMAGE,
  54. ENABLEOFFLINERECORD,
  55. ENABLESINGLERECORD,
  56. PERS_ID,
  57. ORG_ID,
  58. INTM,
  59. UPTM,
  60. FLAG_VALID
  61. </sql>
  62. <sql id="entity_properties">
  63. #{meetingId},
  64. #{persName},
  65. #{orgNm},
  66. #{controlPersId},
  67. #{controlPersName},
  68. #{sms},
  69. #{id},
  70. #{title},
  71. #{startTime},
  72. #{endTime},
  73. #{participants},
  74. #{address},
  75. #{details},
  76. #{autoinvite},
  77. #{password},
  78. #{controlPassword},
  79. #{meetingroomtype},
  80. #{conferencenumber},
  81. #{autorecord},
  82. #{mainimage},
  83. #{enableofflinerecord},
  84. #{enablesinglerecord},
  85. #{persId},
  86. #{orgId},
  87. #{intm},
  88. #{uptm},
  89. #{flagValid}
  90. </sql>
  91. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  92. <sql id="page_where">
  93. <trim prefix="where" prefixOverrides="and | or ">
  94. <if test="persName != null and persName != ''">and PERS_NAME = #{persName}</if>
  95. <if test="orgNm != null and orgNm != ''">and ORG_NM = #{orgNm}</if>
  96. <if test="controlPersId != null and controlPersId != ''">and CONTROL_PERS_ID = #{controlPersId}</if>
  97. <if test="controlPersName != null and controlPersName != ''">and CONTROL_PERS_NAME = #{controlPersName}</if>
  98. <if test="sms != null and sms != ''">and SMS = #{sms}</if>
  99. <if test="id != null and id != ''">and ID = #{id}</if>
  100. <if test="title != null and title != ''">and TITLE = #{title}</if>
  101. <if test="startTime != null">and START_TIME = #{startTime}</if>
  102. <if test="endTime != null">and END_TIME = #{endTime}</if>
  103. <if test="participants != null and participants != ''">and PARTICIPANTS = #{participants}</if>
  104. <if test="address != null and address != ''">and ADDRESS = #{address}</if>
  105. <if test="details != null and details != ''">and DETAILS = #{details}</if>
  106. <if test="autoinvite != null and autoinvite != ''">and AUTOINVITE = #{autoinvite}</if>
  107. <if test="password != null and password != ''">and PASSWORD = #{password}</if>
  108. <if test="controlPassword != null and controlPassword != ''">and CONTROL_PASSWORD = #{controlPassword}</if>
  109. <if test="meetingroomtype != null and meetingroomtype != ''">and MEETINGROOMTYPE = #{meetingroomtype}</if>
  110. <if test="conferencenumber != null and conferencenumber != ''">and CONFERENCENUMBER = #{conferencenumber}
  111. </if>
  112. <if test="autorecord != null and autorecord != ''">and AUTORECORD = #{autorecord}</if>
  113. <if test="mainimage != null and mainimage != ''">and MAINIMAGE = #{mainimage}</if>
  114. <if test="enableofflinerecord != null and enableofflinerecord != ''">and ENABLEOFFLINERECORD =
  115. #{enableofflinerecord}
  116. </if>
  117. <if test="enablesinglerecord != null and enablesinglerecord != ''">and ENABLESINGLERECORD =
  118. #{enablesinglerecord}
  119. </if>
  120. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  121. <if test="orgId != null and orgId != ''">and ORG_ID = #{orgId}</if>
  122. <if test="intm != null">and INTM = #{intm}</if>
  123. <if test="uptm != null">and UPTM = #{uptm}</if>
  124. <if test="flagValid != null and flagValid != ''">and FLAG_VALID = #{flagValid}</if>
  125. </trim>
  126. </sql>
  127. <select id="getBy" resultMap="bisInspMeetRecodeResultMap">
  128. select
  129. <include refid="table_columns"/>
  130. from bis_insp_meet_recode
  131. <include refid="page_where"/>
  132. </select>
  133. <select id="findAll" resultMap="bisInspMeetRecodeResultMap">
  134. select
  135. <include refid="table_columns"/>
  136. from bis_insp_meet_recode
  137. </select>
  138. <select id="findList" resultMap="bisInspMeetRecodeResultMap">
  139. select
  140. <include refid="table_columns"/>
  141. from bis_insp_meet_recode
  142. <include refid="page_where"/>
  143. </select>
  144. <select id="selectCount" resultType="int">
  145. select count(ID) from bis_insp_meet_recode
  146. <include refid="page_where"/>
  147. </select>
  148. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspMeetRecode">
  149. insert into bis_insp_meet_recode(
  150. <include refid="table_columns"/>
  151. )
  152. values (
  153. <include refid="entity_properties"/>
  154. )
  155. </insert>
  156. <delete id="delete" parameterType="java.lang.String">
  157. delete from bis_insp_meet_recode where ID = #{id}
  158. </delete>
  159. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspMeetRecode">
  160. delete from bis_insp_meet_recode
  161. <include refid="page_where"/>
  162. </delete>
  163. <update id="deleteInFlag" parameterType="java.lang.String">
  164. update bis_insp_meet_recode set flag_valid = 0 where ID = #{id}
  165. </update>
  166. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspMeetRecode">
  167. update bis_insp_meet_recode
  168. <trim prefix="set" suffixOverrides=",">
  169. <if test="persName != null and persName != ''">PERS_NAME = #{persName},</if>
  170. <if test="orgNm != null and orgNm != ''">ORG_NM = #{orgNm},</if>
  171. <if test="controlPersId != null and controlPersId != ''">CONTROL_PERS_ID = #{controlPersId},</if>
  172. <if test="controlPersName != null and controlPersName != ''">CONTROL_PERS_NAME = #{controlPersName},</if>
  173. <if test="sms != null and sms != ''">SMS = #{sms},</if>
  174. <if test="id != null and id != ''">ID = #{id},</if>
  175. <if test="title != null and title != ''">TITLE = #{title},</if>
  176. <if test="startTime != null">START_TIME = #{startTime},</if>
  177. <if test="endTime != null">END_TIME = #{endTime},</if>
  178. <if test="participants != null and participants != ''">PARTICIPANTS = #{participants},</if>
  179. <if test="address != null and address != ''">ADDRESS = #{address},</if>
  180. <if test="details != null and details != ''">DETAILS = #{details},</if>
  181. <if test="autoinvite != null and autoinvite != ''">AUTOINVITE = #{autoinvite},</if>
  182. <if test="password != null and password != ''">PASSWORD = #{password},</if>
  183. <if test="controlPassword != null and controlPassword != ''">CONTROL_PASSWORD = #{controlPassword},</if>
  184. <if test="meetingroomtype != null and meetingroomtype != ''">MEETINGROOMTYPE = #{meetingroomtype},</if>
  185. <if test="conferencenumber != null and conferencenumber != ''">CONFERENCENUMBER = #{conferencenumber},</if>
  186. <if test="autorecord != null and autorecord != ''">AUTORECORD = #{autorecord},</if>
  187. <if test="mainimage != null and mainimage != ''">MAINIMAGE = #{mainimage},</if>
  188. <if test="enableofflinerecord != null and enableofflinerecord != ''">ENABLEOFFLINERECORD =
  189. #{enableofflinerecord},
  190. </if>
  191. <if test="enablesinglerecord != null and enablesinglerecord != ''">ENABLESINGLERECORD =
  192. #{enablesinglerecord},
  193. </if>
  194. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  195. <if test="orgId != null and orgId != ''">ORG_ID = #{orgId},</if>
  196. <if test="intm != null">INTM = #{intm},</if>
  197. <if test="uptm != null">UPTM = #{uptm},</if>
  198. <if test="flagValid != null and flagValid != ''">FLAG_VALID = #{flagValid},</if>
  199. </trim>
  200. <where>ID = #{id}</where>
  201. </update>
  202. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspMeetRecode">
  203. update bis_insp_meet_recode
  204. <trim prefix="set" suffixOverrides=",">
  205. <if test="persName != null and persName != ''">PERS_NAME = #{persName},</if>
  206. <if test="orgNm != null and orgNm != ''">ORG_NM = #{orgNm},</if>
  207. <if test="controlPersId != null and controlPersId != ''">CONTROL_PERS_ID = #{controlPersId},</if>
  208. <if test="controlPersName != null and controlPersName != ''">CONTROL_PERS_NAME = #{controlPersName},</if>
  209. <if test="sms != null and sms != ''">SMS = #{sms},</if>
  210. <if test="id != null and id != ''">ID = #{id},</if>
  211. <if test="title != null and title != ''">TITLE = #{title},</if>
  212. <if test="startTime != null">START_TIME = #{startTime},</if>
  213. <if test="endTime != null">END_TIME = #{endTime},</if>
  214. <if test="participants != null and participants != ''">PARTICIPANTS = #{participants},</if>
  215. <if test="address != null and address != ''">ADDRESS = #{address},</if>
  216. <if test="details != null and details != ''">DETAILS = #{details},</if>
  217. <if test="autoinvite != null and autoinvite != ''">AUTOINVITE = #{autoinvite},</if>
  218. <if test="password != null and password != ''">PASSWORD = #{password},</if>
  219. <if test="controlPassword != null and controlPassword != ''">CONTROL_PASSWORD = #{controlPassword},</if>
  220. <if test="meetingroomtype != null and meetingroomtype != ''">MEETINGROOMTYPE = #{meetingroomtype},</if>
  221. <if test="conferencenumber != null and conferencenumber != ''">CONFERENCENUMBER = #{conferencenumber},</if>
  222. <if test="autorecord != null and autorecord != ''">AUTORECORD = #{autorecord},</if>
  223. <if test="mainimage != null and mainimage != ''">MAINIMAGE = #{mainimage},</if>
  224. <if test="enableofflinerecord != null and enableofflinerecord != ''">ENABLEOFFLINERECORD =
  225. #{enableofflinerecord},
  226. </if>
  227. <if test="enablesinglerecord != null and enablesinglerecord != ''">ENABLESINGLERECORD =
  228. #{enablesinglerecord},
  229. </if>
  230. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  231. <if test="orgId != null and orgId != ''">ORG_ID = #{orgId},</if>
  232. <if test="intm != null">INTM = #{intm},</if>
  233. <if test="uptm != null">UPTM = #{uptm},</if>
  234. <if test="flagValid != null and flagValid != ''">FLAG_VALID = #{flagValid},</if>
  235. </trim>
  236. <include refid="page_where"/>
  237. </update>
  238. <select id="get" resultMap="recodeMap" parameterType="String">
  239. SELECT A.*,B.ID CUSTOMS_ID,B.PERS_ID CUSTOMS_PERS_ID,B.PERS_NAME
  240. CUSTOMS_PERS_NAME,B.JNTM,B.MEET_RECODE_ID,B.callnumber
  241. FROM BIS_INSP_MEET_RECODE A
  242. LEFT JOIN BIS_INSP_MEET_MNTS_CUSTOMS B
  243. ON A.ID=B.MEET_RECODE_ID
  244. WHERE A.ID =#{id}
  245. </select>
  246. <!-- 其他自定义SQL -->
  247. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspMeetRecode" id="recodeMap">
  248. <id property="id" column="ID"/>
  249. <result property="meetingId" column="MEETING_ID"/>
  250. <result property="title" column="TITLE"/>
  251. <result property="startTime" column="START_TIME"/>
  252. <result property="endTime" column="END_TIME"/>
  253. <result property="participants" column="PARTICIPANTS"/>
  254. <result property="address" column="ADDRESS"/>
  255. <result property="details" column="DETAILS"/>
  256. <result property="autoinvite" column="AUTOINVITE"/>
  257. <result property="password" column="PASSWORD"/>
  258. <result property="controlPassword" column="CONTROL_PASSWORD"/>
  259. <result property="meetingroomtype" column="MEETINGROOMTYPE"/>
  260. <result property="conferencenumber" column="CONFERENCENUMBER"/>
  261. <result property="autorecord" column="AUTORECORD"/>
  262. <result property="mainimage" column="MAINIMAGE"/>
  263. <result property="enableofflinerecord" column="ENABLEOFFLINERECORD"/>
  264. <result property="enablesinglerecord" column="ENABLESINGLERECORD"/>
  265. <result property="persId" column="PERS_ID"/>
  266. <result property="persName" column="PERS_NAME"/>
  267. <result property="orgId" column="ORG_ID"/>
  268. <result property="orgNm" column="ORG_NM"/>
  269. <result property="intm" column="INTM"/>
  270. <result property="uptm" column="UPTM"/>
  271. <result property="controlPersId" column="CONTROL_PERS_ID"/>
  272. <result property="controlPersName" column="CONTROL_PERS_NAME"/>
  273. <result property="flagValid" column="FLAG_VALID"/>
  274. <result property="sms" column="SMS"/>
  275. <collection property="participantsList" ofType="cn.com.goldenwater.dcproj.model.BisInspMeetMntsCustoms">
  276. <result property="persName" column="CUSTOMS_PERS_NAME"/>
  277. <result property="id" column="CUSTOMS_ID"/>
  278. <result property="persId" column="CUSTOMS_PERS_ID"/>
  279. <result property="meetRecodeId" column="MEET_RECODE_ID"/>
  280. <result property="jntm" column="CUSTOMS_JNTM"/>
  281. <result property="callnumber" column="callnumber"/>
  282. </collection>
  283. </resultMap>
  284. <select id="getRecodeInfo" resultMap="recodeMap">
  285. SELECT A.*,B.ID CUSTOMS_ID,B.PERS_ID CUSTOMS_PERS_ID,B.PERS_NAME
  286. CUSTOMS_PERS_NAME,B.JNTM,B.MEET_RECODE_ID,B.callnumber
  287. FROM BIS_INSP_MEET_RECODE A
  288. LEFT JOIN BIS_INSP_MEET_MNTS_CUSTOMS B
  289. ON A.ID=B.MEET_RECODE_ID
  290. WHERE 1=1
  291. <if test="persId != null and persId != ''">and (
  292. A.ID IN (SELECT DISTINCT MEET_RECODE_ID FROM BIS_INSP_MEET_MNTS_CUSTOMS WHERE PERS_ID=#{persId})
  293. OR A.ID IN (SELECT DISTINCT ID FROM BIS_INSP_MEET_RECODE WHERE CONTROL_PERS_ID =#{persId})
  294. OR A.ID IN (SELECT DISTINCT ID FROM BIS_INSP_MEET_RECODE WHERE PERS_ID =#{persId})
  295. )
  296. </if>
  297. <if test="title != null and title != ''">and title like concat(#{title},'%')</if>
  298. <if test="conferencenumber != null and conferencenumber != ''">and a.conferencenumber =#{conferencenumber}</if>
  299. <if test="tm != null and tm != ''">
  300. and (start_time &gt; STR_TO_DATE(#{tm},'%Y-%m-%d %H:%i:%s')
  301. or
  302. STR_TO_DATE(#{tm},'%Y-%m-%d %H:%i:%s')&lt;END_TIME)
  303. </if>
  304. </select>
  305. </mapper>