DailyRecordTonicDao.xml 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  2. <mapper namespace="cn.ourwill.module.house.dao.daily.DailyRecordTonicDao">
  3. <resultMap type="cn.ourwill.module.house.entity.daily.DailyRecordTonic" id="baseMap">
  4. <result column="id" property="id"/>
  5. <result column="task_id" property="taskId"/>
  6. <result column="tonic_amount" property="tonicAmount"/>
  7. <result column="tonic_date" property="tonicDate"/>
  8. <result column="totalTonicAmount" property="totalTonicAmount"/>
  9. <result column="tonicFrequency" property="tonicFrequency"/>
  10. <result column="task_uuid" property="taskUuid"/>
  11. <result column="uuid" property="uuid"/>
  12. <result column="sync_flag" property="syncFlag"/>
  13. </resultMap>
  14. <sql id="columns">
  15. id ,
  16. task_id ,
  17. tonic_amount ,
  18. tonic_date ,
  19. totalTonicAmount ,
  20. tonicFrequency,
  21. task_uuid,
  22. uuid,
  23. sync_flag
  24. </sql>
  25. <sql id="joinCols">
  26. </sql>
  27. <select id="get" resultMap="baseMap">
  28. SELECT
  29. <include refid="columns"/>
  30. FROM daily_record_tonic a
  31. <include refid="joinCols"/>
  32. WHERE a.id = #{id}
  33. </select>
  34. <select id="getByUuid" resultMap="baseMap">
  35. SELECT
  36. <include refid="columns"/>
  37. FROM daily_record_tonic a
  38. <include refid="joinCols"/>
  39. WHERE a.uuid = #{uuid}
  40. </select>
  41. <select id="findList" resultMap="baseMap">
  42. SELECT
  43. <include refid="columns"/>
  44. FROM daily_record_tonic a
  45. <include refid="joinCols"/>
  46. <where>
  47. <if test="id !=null">
  48. and id = #{id}
  49. </if>
  50. <if test="taskId !=null">
  51. and task_id = #{taskId}
  52. </if>
  53. <if test="tonicAmount !=null">
  54. and tonic_amount = #{tonicAmount}
  55. </if>
  56. <if test="tonicDate !=null">
  57. and tonic_date = #{tonicDate}
  58. </if>
  59. <if test="totalTonicAmount !=null">
  60. and totalTonicAmount = #{totalTonicAmount}
  61. </if>
  62. <if test="tonicFrequency !=null">
  63. and tonicFrequency = #{tonicFrequency}
  64. </if>
  65. <if test="taskUuid !=null">
  66. and task_uuid = #{taskUuid}
  67. </if>
  68. <if test="uuid !=null">
  69. and uuid = #{uuid}
  70. </if>
  71. <if test="syncFlag !=null">
  72. and sync_flag = #{syncFlag}
  73. </if>
  74. </where>
  75. <choose>
  76. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  77. ORDER BY ${page.orderBy}
  78. </when>
  79. <otherwise>
  80. </otherwise>
  81. </choose>
  82. </select>
  83. <select id="findAllList" resultMap="baseMap">
  84. SELECT
  85. <include refid="columns"/>
  86. FROM daily_record_tonic a
  87. <include refid="joinCols"/>
  88. <where>
  89. <if test="id !=null">
  90. and id = #{id}
  91. </if>
  92. <if test="taskId !=null">
  93. and task_id = #{taskId}
  94. </if>
  95. <if test="tonicAmount !=null">
  96. and tonic_amount = #{tonicAmount}
  97. </if>
  98. <if test="tonicDate !=null">
  99. and tonic_date = #{tonicDate}
  100. </if>
  101. <if test="totalTonicAmount !=null">
  102. and totalTonicAmount = #{totalTonicAmount}
  103. </if>
  104. <if test="tonicFrequency !=null">
  105. and tonicFrequency = #{tonicFrequency}
  106. </if>
  107. <if test="taskUuid !=null">
  108. and task_uuid = #{taskUuid}
  109. </if>
  110. <if test="uuid !=null">
  111. and uuid = #{uuid}
  112. </if>
  113. <if test="syncFlag !=null">
  114. and sync_flag = #{syncFlag}
  115. </if>
  116. </where>
  117. <choose>
  118. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  119. ORDER BY ${page.orderBy}
  120. </when>
  121. <otherwise>
  122. </otherwise>
  123. </choose>
  124. </select>
  125. <insert id="insert" keyColumn="id" keyProperty="id" useGeneratedKeys="true"
  126. parameterType="cn.ourwill.module.house.entity.daily.DailyRecordTonic">
  127. INSERT INTO daily_record_tonic
  128. <trim prefix="(" suffix=")" suffixOverrides=",">
  129. <if test=" id != null">
  130. id,
  131. </if>
  132. <if test=" taskId != null">
  133. task_id,
  134. </if>
  135. <if test=" tonicAmount != null">
  136. tonic_amount,
  137. </if>
  138. <if test=" tonicDate != null">
  139. tonic_date,
  140. </if>
  141. <if test=" totalTonicAmount != null">
  142. totalTonicAmount,
  143. </if>
  144. <if test=" tonicFrequency != null">
  145. tonicFrequency,
  146. </if>
  147. <if test="taskUuid !=null">
  148. task_uuid,
  149. </if>
  150. <if test="uuid !=null">
  151. uuid
  152. </if>
  153. <!-- <if test="syncFlag !=null">
  154. sync_flag
  155. </if>-->
  156. </trim>
  157. <trim prefix="values (" suffix=")" suffixOverrides=",">
  158. <if test=" id != null">
  159. #{id}, </if>
  160. <if test=" taskId != null">
  161. #{taskId}, </if>
  162. <if test=" tonicAmount != null">
  163. #{tonicAmount}, </if>
  164. <if test=" tonicDate != null">
  165. #{tonicDate}, </if>
  166. <if test=" totalTonicAmount != null">
  167. #{totalTonicAmount}, </if>
  168. <if test=" tonicFrequency != null">
  169. #{tonicFrequency}, </if>
  170. <if test="taskUuid !=null">
  171. #{taskUuid},
  172. </if>
  173. <if test="uuid !=null">
  174. #{uuid}
  175. </if>
  176. <!--<if test="syncFlag !=null">
  177. #{syncFlag}
  178. </if>-->
  179. </trim>
  180. </insert>
  181. <update id="updateByUuid" parameterType="cn.ourwill.module.house.entity.daily.DailyRecordTonic">
  182. UPDATE daily_record_tonic <set>
  183. <if test="taskId != null">
  184. task_id= #{taskId} ,
  185. </if>
  186. <if test="tonicAmount != null">
  187. tonic_amount= #{tonicAmount} ,
  188. </if>
  189. <if test="tonicDate != null">
  190. tonic_date= #{tonicDate} ,
  191. </if>
  192. <if test="totalTonicAmount != null">
  193. totalTonicAmount= #{totalTonicAmount} ,
  194. </if>
  195. <if test="tonicFrequency != null">
  196. tonicFrequency= #{tonicFrequency},
  197. </if>
  198. <if test="taskUuid !=null">
  199. task_uuid = #{taskUuid},
  200. </if>
  201. <!--<if test="syncFlag !=null">
  202. sync_flag=#{syncFlag},
  203. </if>-->
  204. <if test="uuid !=null">
  205. uuid=#{uuid}
  206. </if>
  207. </set>
  208. WHERE uuid = #{uuid}
  209. </update>
  210. <update id="update" parameterType="cn.ourwill.module.house.entity.daily.DailyRecordTonic">
  211. UPDATE daily_record_tonic <set>
  212. <if test="id != null">
  213. id= #{id} ,
  214. </if>
  215. <if test="taskId != null">
  216. task_id= #{taskId} ,
  217. </if>
  218. <if test="tonicAmount != null">
  219. tonic_amount= #{tonicAmount} ,
  220. </if>
  221. <if test="tonicDate != null">
  222. tonic_date= #{tonicDate} ,
  223. </if>
  224. <if test="totalTonicAmount != null">
  225. totalTonicAmount= #{totalTonicAmount} ,
  226. </if>
  227. <if test="tonicFrequency != null">
  228. tonicFrequency= #{tonicFrequency},
  229. </if>
  230. <if test="taskUuid !=null">
  231. task_uuid = #{taskUuid},
  232. </if>
  233. <if test="uuid !=null">
  234. uuid = #{uuid},
  235. </if>
  236. <if test="syncFlag !=null">
  237. sync_flag = #{syncFlag}
  238. </if>
  239. </set>
  240. WHERE id = #{id}
  241. </update>
  242. <delete id="deleteById" parameterType="java.lang.Long">
  243. DELETE FROM daily_record_tonic WHERE id = #{id}
  244. </delete>
  245. <delete id="deleteByIds" parameterType="java.util.List">
  246. DELETE FROM daily_record_tonic WHERE id IN
  247. <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
  248. #{item}
  249. </foreach>
  250. </delete>
  251. </mapper>