CheckDomainItemDao.xml 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  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.CheckDomainItemDao">
  4. <resultMap type="cn.ourwill.module.house.entity.daily.CheckDomainItem" id="baseMap">
  5. <result column="id" property="id"/>
  6. <result column="uuid" property="uuid"/>
  7. <result column="c_id" property="cId"/>
  8. <result column="c_time" property="cTime"/>
  9. <result column="u_id" property="uId"/>
  10. <result column="u_time" property="uTime"/>
  11. <result column="version" property="version"/>
  12. <result column="check_domain_id" property="checkDomainId"/>
  13. <result column="check_domain_name" property="checkDomainName"/>
  14. <result column="post" property="post"/>
  15. <result column="check_domain_itemname" property="checkDomainItemName"/>
  16. <result column="check_domain_itemdetail" property="checkDomainItemDetail"/>
  17. </resultMap>
  18. <sql id="columns">
  19. id,
  20. check_domain_id,
  21. check_domain_name,
  22. post,
  23. check_domain_itemname,
  24. check_domain_itemdetail
  25. </sql>
  26. <sql id="joinCols">
  27. </sql>
  28. <select id="get" resultMap="baseMap">
  29. SELECT
  30. <include refid="columns"/>
  31. FROM check_domain_item a
  32. <include refid="joinCols"/>
  33. WHERE a.id = #{id}
  34. </select>
  35. <select id="findList" resultMap="baseMap">
  36. SELECT
  37. <include refid="columns"/>
  38. FROM check_domain_item a
  39. <include refid="joinCols"/>
  40. <where>
  41. <if test="id !=null">
  42. and id = #{id}
  43. </if>
  44. <if test="checkDomainId !=null">
  45. and check_domain_id = #{checkDomainId}
  46. </if>
  47. <if test="checkDomainName !=null">
  48. and check_domain_name like CONCAT('%',#{checkDomainName},'%')
  49. </if>
  50. <if test="post !=null">
  51. and post = #{post}
  52. </if>
  53. <if test="checkDomainItemDetail !=null">
  54. and check_domain_itemdetail = #{checkDomainItemDetail}
  55. </if>
  56. <if test="cTime !=null">
  57. and c_time = #{cTime}
  58. </if>
  59. <if test="cId !=null">
  60. and c_id = #{cId}
  61. </if>
  62. <if test="uTime !=null">
  63. and u_time = #{uTime}
  64. </if>
  65. <if test="uId !=null">
  66. and u_id = #{uId}
  67. </if>
  68. <if test="version !=null">
  69. and version = #{version}
  70. </if>
  71. </where>
  72. <choose>
  73. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  74. ORDER BY ${page.orderBy}
  75. </when>
  76. <otherwise>
  77. </otherwise>
  78. </choose>
  79. </select>
  80. <select id="findAllList" resultMap="baseMap">
  81. SELECT
  82. <include refid="columns"/>
  83. FROM check_domain_item a
  84. <include refid="joinCols"/>
  85. <where>
  86. <if test="id !=null">
  87. and id = #{id}
  88. </if>
  89. <if test="checkDomainId !=null">
  90. and check_domain_id = #{checkDomainId}
  91. </if>
  92. <if test="checkDomainName !=null">
  93. and check_domain_name like CONCAT('%',#{checkDomainName},'%')
  94. </if>
  95. <if test="post !=null">
  96. and post = #{post}
  97. </if>
  98. <if test="checkDomainItemDetail !=null">
  99. and check_domain_itemdetail = #{checkDomainItemDetail}
  100. </if>
  101. <if test="cTime !=null">
  102. and c_time = #{cTime}
  103. </if>
  104. <if test="cId !=null">
  105. and c_id = #{cId}
  106. </if>
  107. <if test="uTime !=null">
  108. and u_time = #{uTime}
  109. </if>
  110. <if test="uId !=null">
  111. and u_id = #{uId}
  112. </if>
  113. <if test="version !=null">
  114. and version = #{version}
  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.CheckDomain">
  127. INSERT INTO check_domain_item
  128. <trim prefix="(" suffix=")" suffixOverrides=",">
  129. <if test=" id != null">
  130. id,
  131. </if>
  132. <if test=" checkDomainId != null">
  133. check_domain_id,
  134. </if>
  135. <if test=" checkDomainName != null">
  136. check_domain_name,
  137. </if>
  138. <if test=" post != null">
  139. post,
  140. </if>
  141. <if test=" checkDomainItemName != null">
  142. check_domain_itemname,
  143. </if>
  144. <if test="checkDomainItemDetail !=null">
  145. check_domain_itemdetail,
  146. </if>
  147. <!--<if test=" cTime != null">-->
  148. <!--c_time,-->
  149. <!--</if>-->
  150. <!--<if test=" cId != null">-->
  151. <!--c_id,-->
  152. <!--</if>-->
  153. <!--<if test=" uTime != null">-->
  154. <!--u_time,-->
  155. <!--</if>-->
  156. <!--<if test=" uId != null">-->
  157. <!--u_id,-->
  158. <!--</if>-->
  159. <!--<if test=" version != null">-->
  160. <!--version-->
  161. <!--</if>-->
  162. </trim>
  163. <trim prefix="values (" suffix=")" suffixOverrides=",">
  164. <if test=" id != null">
  165. #{id},
  166. </if>
  167. <if test=" checkDomainId != null">
  168. #{checkDomainId},
  169. </if>
  170. <if test=" checkDomainName != null">
  171. #{checkDomainName},
  172. </if>
  173. <if test="post !=null">
  174. #{post},
  175. </if>
  176. <if test=" checkDomainItemName != null">
  177. #{checkDomainItemName},
  178. </if>
  179. <if test="checkDomainItemDetail !=null">
  180. #{checkDomainItemDetail},
  181. </if>
  182. <!--<if test=" cTime != null">-->
  183. <!--#{cTime},-->
  184. <!--</if>-->
  185. <!--<if test=" cId != null">-->
  186. <!--#{cId},-->
  187. <!--</if>-->
  188. <!--<if test=" uTime != null">-->
  189. <!--#{uTime},-->
  190. <!--</if>-->
  191. <!--<if test=" uId != null">-->
  192. <!--#{uId},-->
  193. <!--</if>-->
  194. <!--<if test=" version != null">-->
  195. <!--#{version}-->
  196. <!--</if>-->
  197. </trim>
  198. </insert>
  199. <update id="update" parameterType="cn.ourwill.module.house.entity.daily.CheckDomain">
  200. UPDATE check_domain_item
  201. <set>
  202. <if test="checkDomainName != null">
  203. check_domain_name= #{checkDomainName} ,
  204. </if>
  205. <if test="post != null">
  206. post= #{post} ,
  207. </if>
  208. <if test="checkDomainItemName != null">
  209. check_domain_itemname= #{checkDomainItemName} ,
  210. </if>
  211. <if test="checkDomainItemDetail != null">
  212. check_domain_itemdetail= #{checkDomainItemDetail} ,
  213. </if>
  214. <if test="cTime != null">
  215. c_time= #{cTime} ,
  216. </if>
  217. <if test="cId != null">
  218. c_id= #{cId} ,
  219. </if>
  220. <if test="uTime != null">
  221. u_time= #{uTime} ,
  222. </if>
  223. <if test="uId != null">
  224. u_id= #{uId} ,
  225. </if>
  226. <if test="version != null">
  227. version= #{version}
  228. </if>
  229. </set>
  230. WHERE id = #{id}
  231. </update>
  232. <delete id="deleteById" parameterType="java.lang.Long">
  233. DELETE FROM check_domain_item
  234. WHERE id = #{id}
  235. </delete>
  236. <delete id="deleteByIds" parameterType="java.util.List">
  237. DELETE FROM check_domain_item WHERE id IN
  238. <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
  239. #{item}
  240. </foreach>
  241. </delete>
  242. </mapper>