TOrderPublicReleaseCountMapper.xml 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  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="com.goafanti.common.dao.TOrderPublicReleaseCountMapper">
  4. <resultMap type="com.goafanti.common.model.TOrderPublicReleaseCount" id="TOrderPublicReleaseCountMap">
  5. <result property="id" column="id" jdbcType="INTEGER"/>
  6. <result property="orderNo" column="order_no" jdbcType="VARCHAR"/>
  7. <result property="actualDuration" column="actual_duration" jdbcType="NUMERIC"/>
  8. <result property="peopleCount" column="people_count" jdbcType="INTEGER"/>
  9. <result property="frequency" column="frequency" jdbcType="INTEGER"/>
  10. <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
  11. <result property="maxDuration" column="max_duration" jdbcType="NUMERIC"/>
  12. <result property="maxProcess" column="max_process" jdbcType="INTEGER"/>
  13. <result property="maxType" column="max_type" jdbcType="INTEGER"/>
  14. <result property="maxStatus" column="max_status" jdbcType="INTEGER"/>
  15. </resultMap>
  16. <sql id="TOrderPublicReleaseCountAllSql">
  17. id, order_no, actual_duration, people_count, frequency, create_time, max_duration, max_process, max_type, max_status
  18. </sql>
  19. <!--查询单个-->
  20. <select id="queryById" resultMap="TOrderPublicReleaseCountMap">
  21. select
  22. <include refid="TOrderPublicReleaseCountAllSql"/>
  23. from t_order_public_release_count
  24. where id = #{id}
  25. </select>
  26. <!--查询指定行数据-->
  27. <select id="findTOrderPublicReleaseCountList" resultMap="TOrderPublicReleaseCountMap">
  28. select
  29. <include refid="TOrderPublicReleaseCountAllSql"/>
  30. from t_order_public_release_count
  31. <where>
  32. <if test="id != null">
  33. and id = #{id}
  34. </if>
  35. <if test="orderNo != null and orderNo != ''">
  36. and order_no = #{orderNo}
  37. </if>
  38. <if test="actualDuration != null">
  39. and actual_duration = #{actualDuration}
  40. </if>
  41. <if test="peopleCount != null">
  42. and people_count = #{peopleCount}
  43. </if>
  44. <if test="frequency != null">
  45. and frequency = #{frequency}
  46. </if>
  47. <if test="createTime != null">
  48. and create_time = #{createTime}
  49. </if>
  50. <if test="maxDuration != null">
  51. and max_duration = #{maxDuration}
  52. </if>
  53. <if test="maxProcess != null">
  54. and max_process = #{maxProcess}
  55. </if>
  56. <if test="maxType != null">
  57. and max_type = #{maxType}
  58. </if>
  59. <if test="maxStatus != null">
  60. and max_status = #{maxStatus}
  61. </if>
  62. </where>
  63. <if test="page_sql != null">
  64. ${page_sql}
  65. </if>
  66. </select>
  67. <!--统计总行数-->
  68. <select id="findTOrderPublicReleaseCountCount" resultType="java.lang.Integer">
  69. select count(1)
  70. from t_order_public_release_count
  71. <where>
  72. <if test="id != null">
  73. and id = #{id}
  74. </if>
  75. <if test="orderNo != null and orderNo != ''">
  76. and order_no = #{orderNo}
  77. </if>
  78. <if test="actualDuration != null">
  79. and actual_duration = #{actualDuration}
  80. </if>
  81. <if test="peopleCount != null">
  82. and people_count = #{peopleCount}
  83. </if>
  84. <if test="frequency != null">
  85. and frequency = #{frequency}
  86. </if>
  87. <if test="createTime != null">
  88. and create_time = #{createTime}
  89. </if>
  90. <if test="maxDuration != null">
  91. and max_duration = #{maxDuration}
  92. </if>
  93. <if test="maxProcess != null">
  94. and max_process = #{maxProcess}
  95. </if>
  96. <if test="maxType != null">
  97. and max_type = #{maxType}
  98. </if>
  99. <if test="maxStatus != null">
  100. and max_status = #{maxStatus}
  101. </if>
  102. </where>
  103. </select>
  104. <!--新增所有列-->
  105. <insert id="insert" keyProperty="id" useGeneratedKeys="true">
  106. insert into t_order_public_release_count(order_no, actual_duration, people_count, frequency, create_time,
  107. max_duration, max_process, max_type, max_status)
  108. values (#{orderNo}, #{actualDuration}, #{peopleCount}, #{frequency}, #{createTime}, #{maxDuration},
  109. #{maxProcess}, #{maxType}, #{maxStatus})
  110. </insert>
  111. <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
  112. insert into t_order_public_release_count(order_no, actual_duration, people_count, frequency, create_time,
  113. max_duration, max_process, max_type, max_status)
  114. values
  115. <foreach collection="entities" item="entity" separator=",">
  116. (#{entity.orderNo}, #{entity.actualDuration}, #{entity.peopleCount}, #{entity.frequency},
  117. #{entity.createTime}, #{entity.maxDuration}, #{entity.maxProcess}, #{entity.maxType}, #{entity.maxStatus})
  118. </foreach>
  119. </insert>
  120. <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
  121. insert into t_order_public_release_count(order_no, actual_duration, people_count, frequency, create_time,
  122. max_duration, max_process, max_type, max_status)
  123. values
  124. <foreach collection="entities" item="entity" separator=",">
  125. (#{entity.orderNo}, #{entity.actualDuration}, #{entity.peopleCount}, #{entity.frequency},
  126. #{entity.createTime}, #{entity.maxDuration}, #{entity.maxProcess}, #{entity.maxType}, #{entity.maxStatus})
  127. </foreach>
  128. on duplicate key update
  129. order_no = values(order_no),
  130. actual_duration = values(actual_duration),
  131. people_count = values(people_count),
  132. frequency = values(frequency),
  133. create_time = values(create_time),
  134. max_duration = values(max_duration),
  135. max_process = values(max_process),
  136. max_type = values(max_type),
  137. max_status = values(max_status)
  138. </insert>
  139. <!--通过主键修改数据-->
  140. <update id="update">
  141. update t_order_public_release_count
  142. <set>
  143. <if test="orderNo != null and orderNo != ''">
  144. order_no = #{orderNo},
  145. </if>
  146. <if test="actualDuration != null">
  147. actual_duration = #{actualDuration},
  148. </if>
  149. <if test="peopleCount != null">
  150. people_count = #{peopleCount},
  151. </if>
  152. <if test="frequency != null">
  153. frequency = #{frequency},
  154. </if>
  155. <if test="createTime != null">
  156. create_time = #{createTime},
  157. </if>
  158. <if test="maxDuration != null">
  159. max_duration = #{maxDuration},
  160. </if>
  161. <if test="maxProcess != null">
  162. max_process = #{maxProcess},
  163. </if>
  164. <if test="maxType != null">
  165. max_type = #{maxType},
  166. </if>
  167. <if test="maxStatus != null">
  168. max_status = #{maxStatus},
  169. </if>
  170. </set>
  171. where id = #{id}
  172. </update>
  173. <!--通过主键删除-->
  174. <delete id="deleteById">
  175. delete
  176. from t_order_public_release_count
  177. where id = #{id}
  178. </delete>
  179. <update id="updateByOrderNo">
  180. update t_order_public_release_count
  181. <set>
  182. <if test="actualDuration != null">
  183. actual_duration = #{actualDuration},
  184. </if>
  185. <if test="peopleCount != null">
  186. people_count = #{peopleCount},
  187. </if>
  188. <if test="frequency != null">
  189. frequency = #{frequency},
  190. </if>
  191. <if test="createTime != null">
  192. create_time = #{createTime},
  193. </if>
  194. <if test="maxDuration != null">
  195. max_duration = #{maxDuration},
  196. </if>
  197. <if test="maxProcess != null">
  198. max_process = #{maxProcess},
  199. </if>
  200. <if test="maxType != null">
  201. max_type = #{maxType},
  202. </if>
  203. <if test="maxStatus != null">
  204. max_status = #{maxStatus},
  205. </if>
  206. </set>
  207. where order_no = #{orderNo,jdbcType=VARCHAR}
  208. </update>
  209. <select id="selectByOrderNo" resultMap="TOrderPublicReleaseCountMap">
  210. select
  211. <include refid="TOrderPublicReleaseCountAllSql"/>
  212. from t_order_public_release_count
  213. where order_no = #{orderNo,jdbcType=VARCHAR}
  214. </select>
  215. </mapper>