DailyRecordFoodbasilocatesFileDao.xml 5.5 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.ourwill.module.house.dao.daily.DailyRecordFoodbasicinfolocatesFileDao">
  4. <resultMap type="cn.ourwill.module.house.entity.daily.DailyRecordFoodbasicinfolocatesFile" id="baseMap">
  5. <result column="id" property="id"/>
  6. <result column="changeTime" property="changeTime"/>
  7. <result column="oldNumber" property="oldNumber"/>
  8. <result column="newNumber" property="newNumber"/>
  9. <result column="cId" property="cId"/>
  10. <result column="uId" property="uId"/>
  11. <result column="cTime" property="cTime"/>
  12. <result column="houseId" property="houseId"/>
  13. <result column="foodbasicinfoId" property="foodbasicinfoId"/>
  14. <result column="file_uuid" property="fileUuid"/>
  15. <result column="grain_number" property="grainNumber"/>
  16. <result column="change_record" property="changeRecord"/>
  17. </resultMap>
  18. <sql id="columns">
  19. id ,
  20. changeTime ,
  21. oldNumber ,
  22. newNumber ,
  23. cId ,
  24. uId ,
  25. cTime ,
  26. houseId ,
  27. foodbasicinfoId,
  28. file_uuid,
  29. grain_number,
  30. change_record
  31. </sql>
  32. <sql id="joinCols">
  33. </sql>
  34. <select id="get" resultMap="baseMap">
  35. SELECT
  36. <include refid="columns"/>
  37. FROM daily_record_foodbasicinfolocates a
  38. <include refid="joinCols"/>
  39. WHERE a.id = #{id}
  40. </select>
  41. <select id="findList" resultMap="baseMap">
  42. SELECT
  43. <include refid="columns"/>
  44. FROM daily_record_foodbasicinfolocates_file a
  45. <include refid="joinCols"/>
  46. <where>
  47. <if test="id !=null">
  48. and id = #{id}
  49. </if>
  50. <if test="changeTime !=null">
  51. and changeTime = #{changeTime}
  52. </if>
  53. <if test="oldNumber !=null">
  54. and oldNumber = #{oldNumber}
  55. </if>
  56. <if test="newNumber !=null">
  57. and newNumber = #{newNumber}
  58. </if>
  59. <if test="cId !=null">
  60. and cId = #{cId}
  61. </if>
  62. <if test="uId !=null">
  63. and uId = #{uId}
  64. </if>
  65. <if test="cTime !=null">
  66. and cTime = #{cTime}
  67. </if>
  68. <if test="houseId !=null">
  69. and houseId = #{houseId}
  70. </if>
  71. <if test="foodbasicinfoId !=null">
  72. and foodbasicinfoId = #{foodbasicinfoId}
  73. </if>
  74. <if test="fileUuid !=null">
  75. and file_uuid = #{fileUuid}
  76. </if>
  77. <if test="grainNumber !=null">
  78. and grain_number = #{grainNumber}
  79. </if>
  80. <if test="changeRecord !=null">
  81. and change_record = #{changeRecord}
  82. </if>
  83. </where>
  84. <choose>
  85. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  86. ORDER BY ${page.orderBy}
  87. </when>
  88. <otherwise>
  89. </otherwise>
  90. </choose>
  91. </select>
  92. <insert id="insert" keyColumn="id" keyProperty="id" useGeneratedKeys="true"
  93. parameterType="cn.ourwill.module.house.entity.daily.DailyRecordFoodbasicinfolocatesFile">
  94. INSERT INTO daily_record_foodbasicinfolocates_file
  95. <trim prefix="(" suffix=")" suffixOverrides=",">
  96. <!-- <if test=" id != null">
  97. id,
  98. </if>-->
  99. <if test=" changeTime != null">
  100. changeTime,
  101. </if>
  102. <if test=" oldNumber != null">
  103. oldNumber,
  104. </if>
  105. <if test=" newNumber != null">
  106. newNumber,
  107. </if>
  108. <if test=" cId != null">
  109. cId,
  110. </if>
  111. <if test=" uId != null">
  112. uId,
  113. </if>
  114. <if test=" cTime != null">
  115. cTime,
  116. </if>
  117. <if test=" houseId != null">
  118. houseId,
  119. </if>
  120. <if test=" foodbasicinfoId != null">
  121. foodbasicinfoId,
  122. </if>
  123. <if test=" fileUuid != null">
  124. file_uuid,
  125. </if>
  126. <if test="grainNumber !=null">
  127. grain_number,
  128. </if>
  129. <if test="changeRecord !=null">
  130. change_record
  131. </if>
  132. </trim>
  133. <trim prefix="values (" suffix=")" suffixOverrides=",">
  134. <!--<if test="id !=null">
  135. #{id},
  136. </if>-->
  137. <if test=" changeTime != null">
  138. #{changeTime}, </if>
  139. <if test=" oldNumber != null">
  140. #{oldNumber}, </if>
  141. <if test=" newNumber != null">
  142. #{newNumber}, </if>
  143. <if test=" cId != null">
  144. #{cId}, </if>
  145. <if test=" uId != null">
  146. #{uId}, </if>
  147. <if test=" cTime != null">
  148. #{cTime}, </if>
  149. <if test=" houseId != null">
  150. #{houseId}, </if>
  151. <if test=" foodbasicinfoId != null">
  152. #{foodbasicinfoId}, </if>
  153. <if test=" fileUuid != null">
  154. #{fileUuid}, </if>
  155. <if test="grainNumber !=null">
  156. #{grainNumber},</if>
  157. <if test="changeRecord !=null">
  158. #{changeRecord}</if>
  159. </trim>
  160. </insert>
  161. </mapper>