DailyRecordInoutputFileDao.xml 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  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.ourwill.module.house.dao.daily.DailyRecordInoutputFileDao">
  4. <resultMap type="cn.ourwill.module.house.entity.daily.DailyRecordInoutputFile" id="baseMap">
  5. <result column="id" property="id"/>
  6. <result column="uuid" property="uuid"/>
  7. <result column="house_id" property="houseId"/>
  8. <result column="c_id" property="cId"/>
  9. <result column="c_time" property="cTime"/>
  10. <result column="u_id" property="uId"/>
  11. <result column="u_time" property="uTime"/>
  12. <result column="version" property="version"/>
  13. <result column="type" property="type"/>
  14. <result column="htype" property="htype"/>
  15. <result column="recorder" property="recorder"/>
  16. <result column="record_date" property="recordDate"/>
  17. <result column="classes" property="classes"/>
  18. <result column="record_num" property="recordNum"/>
  19. <result column="store_num" property="storeNum"/>
  20. <result column="plan_num" property="planNum"/>
  21. <result column="details" property="details"/>
  22. <result column="plan_scale" property="planScale"/>
  23. <result column="checker" property="checker"/>
  24. <result column="file_uuid" property="fileUuid"/>
  25. </resultMap>
  26. <sql id="dailyRecordInoutputColumns">
  27. id ,
  28. `type`,
  29. htype,
  30. recorder ,
  31. record_date ,
  32. `classes` ,
  33. record_num ,
  34. store_num ,
  35. plan_num ,
  36. details ,
  37. house_id,
  38. c_id ,
  39. c_time ,
  40. u_id ,
  41. u_time ,
  42. version,
  43. plan_scale,
  44. checker,
  45. file_uuid
  46. </sql>
  47. <sql id="dailyRecordInoutputJoins">
  48. </sql>
  49. <select id="get" resultMap="baseMap">
  50. SELECT
  51. <include refid="dailyRecordInoutputColumns"/>
  52. FROM daily_record_inoutput_file a
  53. <include refid="dailyRecordInoutputJoins"/>
  54. WHERE a.id = #{id}
  55. </select>
  56. <select id="findList" resultMap="baseMap">
  57. SELECT
  58. <include refid="dailyRecordInoutputColumns"/>
  59. FROM daily_record_inoutput_file a
  60. <include refid="dailyRecordInoutputJoins"/>
  61. <where>
  62. <if test="id !=null">
  63. and id = #{id}
  64. </if>
  65. <if test="type !=null">
  66. and `type` = #{type}
  67. </if>
  68. <if test="htype !=null">
  69. and `htype` = #{htype}
  70. </if>
  71. <if test="searchStartDate !=null">
  72. and record_date &gt;= #{searchStartDate}
  73. </if>
  74. <if test="searchEndDate !=null">
  75. and record_date &lt;= #{searchEndDate}
  76. </if>
  77. <if test="houseId !=null">
  78. and house_id = #{houseId}
  79. </if>
  80. <if test="checker !=null">
  81. and checker = #{checker}
  82. </if>
  83. <if test="cId !=null">
  84. and c_id = #{cId}
  85. </if>
  86. <if test="cTime !=null">
  87. and c_time = #{cTime}
  88. </if>
  89. <if test="uId !=null">
  90. and u_id = #{uId}
  91. </if>
  92. <if test="uTime !=null">
  93. and u_time = #{uTime}
  94. </if>
  95. <if test="version !=null">
  96. and version = #{version}
  97. </if>
  98. <if test="fileUuid !=null">
  99. and file_uuid = #{fileUuid}
  100. </if>
  101. </where>
  102. <choose>
  103. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  104. ORDER BY ${page.orderBy}
  105. </when>
  106. <otherwise>
  107. order by id desc
  108. </otherwise>
  109. </choose>
  110. </select>
  111. <insert id="insert" keyColumn="id" keyProperty="id" useGeneratedKeys="true"
  112. parameterType="cn.ourwill.module.house.entity.daily.DailyRecordInoutputFile">
  113. INSERT INTO daily_record_inoutput_file
  114. <trim prefix="(" suffix=")" suffixOverrides=",">
  115. <!-- <if test="id !=null">
  116. id,
  117. </if>-->
  118. <if test="uuid != null">
  119. `uuid`,
  120. </if>
  121. <if test="type != null">
  122. `type`,
  123. </if>
  124. <if test="htype != null">
  125. `htype`,
  126. </if>
  127. <if test=" recorder != null">
  128. recorder,
  129. </if>
  130. <if test=" recordDate != null">
  131. record_date,
  132. </if>
  133. <if test=" classes != null">
  134. classes,
  135. </if>
  136. <if test=" recordNum != null">
  137. record_num,
  138. </if>
  139. <if test=" storeNum != null">
  140. store_num,
  141. </if>
  142. <if test=" planNum != null">
  143. plan_num,
  144. </if>
  145. <if test=" details != null">
  146. details,
  147. </if>
  148. <if test="houseId != null">
  149. house_id,
  150. </if>
  151. <if test="checker !=null">
  152. checker,
  153. </if>
  154. <if test=" cId != null">
  155. c_id,
  156. </if>
  157. <if test=" cTime != null">
  158. c_time,
  159. </if>
  160. <if test=" uId != null">
  161. u_id,
  162. </if>
  163. <if test=" uTime != null">
  164. u_time,
  165. </if>
  166. <if test=" version != null">
  167. version,
  168. </if>
  169. <if test="planScale != null and planScale!=''">
  170. plan_scale,
  171. </if>
  172. <if test="fileUuid != null">
  173. file_uuid
  174. </if>
  175. </trim>
  176. <trim prefix="values (" suffix=")" suffixOverrides=",">
  177. <!--<if test="id !=null">
  178. #{id},
  179. </if>-->
  180. <if test="uuid != null">
  181. #{uuid},
  182. </if>
  183. <if test="type != null">
  184. #{type},
  185. </if>
  186. <if test="htype != null">
  187. #{htype},
  188. </if>
  189. <if test=" recorder != null">
  190. #{recorder},
  191. </if>
  192. <if test=" recordDate != null">
  193. #{recordDate},
  194. </if>
  195. <if test=" classes != null">
  196. #{classes},
  197. </if>
  198. <if test=" recordNum != null">
  199. #{recordNum},
  200. </if>
  201. <if test=" storeNum != null">
  202. #{storeNum},
  203. </if>
  204. <if test=" planNum != null">
  205. #{planNum},
  206. </if>
  207. <if test=" details != null">
  208. #{details},
  209. </if>
  210. <if test=" houseId != null">
  211. #{houseId},
  212. </if>
  213. <if test="checker !=null">
  214. #{checker},
  215. </if>
  216. <if test=" cId != null">
  217. #{cId},
  218. </if>
  219. <if test=" cTime != null">
  220. #{cTime},
  221. </if>
  222. <if test=" uId != null">
  223. #{uId},
  224. </if>
  225. <if test=" uTime != null">
  226. #{uTime},
  227. </if>
  228. <if test=" version != null">
  229. #{version},
  230. </if>
  231. <if test="planScale !=null and planScale!=''">
  232. #{planScale}, </if>
  233. <if test="fileUuid !=null">
  234. #{fileUuid}
  235. </if>
  236. </trim>
  237. </insert>
  238. </mapper>