TaskFormMapper.xml 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  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.bz.smart_city.dao.TaskFormMapper">
  4. <!--auto generated Code-->
  5. <resultMap id="BaseResultMap" type="com.bz.smart_city.entity.TaskForm">
  6. <result column="id" property="id" jdbcType="INTEGER"/>
  7. <result column="site_id" property="siteId" jdbcType="INTEGER"/>
  8. <result column="client_type" property="clientType" jdbcType="VARCHAR"/>
  9. <result column="form_name" property="formName" jdbcType="VARCHAR"/>
  10. <result column="form_key" property="formKey" jdbcType="VARCHAR"/>
  11. <result column="form_content" property="formContent" jdbcType="VARCHAR"/>
  12. <result column="form_category" property="formCategory" jdbcType="VARCHAR"/>
  13. <result column="status" property="status" jdbcType="INTEGER"/>
  14. <result column="create_by" property="createBy" jdbcType="VARCHAR"/>
  15. <result column="update_by" property="updateBy" jdbcType="VARCHAR"/>
  16. <result column="date_create" property="dateCreate" jdbcType="TIMESTAMP"/>
  17. <result column="date_update" property="dateUpdate" jdbcType="TIMESTAMP"/>
  18. </resultMap>
  19. <!--auto generated Code-->
  20. <sql id="Base_Column_List">
  21. id,
  22. site_id,
  23. client_type,
  24. form_name,
  25. form_key,
  26. form_content,
  27. form_category,
  28. status,
  29. create_by,
  30. update_by,
  31. date_create,
  32. date_update
  33. </sql>
  34. <!--auto generated Code-->
  35. <insert id="insert" useGeneratedKeys="true" keyProperty="taskForm.id">
  36. INSERT INTO sc_task_form (
  37. id,
  38. site_id,
  39. client_type,
  40. form_name,
  41. form_key,
  42. form_content,
  43. form_category,
  44. status,
  45. create_by,
  46. update_by,
  47. date_create,
  48. date_update
  49. ) VALUES (
  50. #{taskForm.id,jdbcType=INTEGER},
  51. #{taskForm.siteId,jdbcType=INTEGER},
  52. #{taskForm.clientType,jdbcType=VARCHAR},
  53. #{taskForm.formName,jdbcType=VARCHAR},
  54. #{taskForm.formKey,jdbcType=VARCHAR},
  55. #{taskForm.formContent,jdbcType=VARCHAR},
  56. #{taskForm.formCategory,jdbcType=VARCHAR},
  57. #{taskForm.status,jdbcType=INTEGER},
  58. #{taskForm.createBy,jdbcType=VARCHAR},
  59. #{taskForm.updateBy,jdbcType=VARCHAR},
  60. #{taskForm.dateCreate,jdbcType=TIMESTAMP},
  61. #{taskForm.dateUpdate,jdbcType=TIMESTAMP}
  62. )
  63. </insert>
  64. <!--auto generated Code-->
  65. <insert id="insertSelective" useGeneratedKeys="true" keyProperty="taskForm.id">
  66. INSERT INTO sc_task_form
  67. <trim prefix="(" suffix=")" suffixOverrides=",">
  68. <if test="taskForm.id!=null"> id,</if>
  69. <if test="taskForm.siteId!=null"> site_id,</if>
  70. <if test="taskForm.formName!=null"> form_name,</if>
  71. <if test="taskForm.formKey!=null"> form_key,</if>
  72. <if test="taskForm.formContent!=null"> form_content,</if>
  73. <if test="taskForm.formCategory!=null"> form_category,</if>
  74. <if test="taskForm.status!=null"> status,</if>
  75. <if test="taskForm.createBy!=null"> create_by,</if>
  76. <if test="taskForm.updateBy!=null"> update_by,</if>
  77. <if test="taskForm.dateCreate!=null"> date_create,</if>
  78. <if test="taskForm.dateUpdate!=null"> date_update,</if>
  79. </trim>
  80. VALUES
  81. <trim prefix="(" suffix=")" suffixOverrides=",">
  82. <if test="taskForm.id!=null">#{taskForm.id,jdbcType=INTEGER},
  83. </if>
  84. <if test="taskForm.siteId!=null">#{taskForm.siteId,jdbcType=INTEGER},
  85. </if>
  86. <if test="taskForm.formName!=null">#{taskForm.formName,jdbcType=VARCHAR},
  87. </if>
  88. <if test="taskForm.formKey!=null">#{taskForm.formKey,jdbcType=VARCHAR},
  89. </if>
  90. <if test="taskForm.formContent!=null">#{taskForm.formContent,jdbcType=VARCHAR},
  91. </if>
  92. <if test="taskForm.formCategory!=null">#{taskForm.formCategory,jdbcType=VARCHAR},
  93. </if>
  94. <if test="taskForm.status!=null">#{taskForm.status,jdbcType=INTEGER},
  95. </if>
  96. <if test="taskForm.createBy!=null">#{taskForm.createBy,jdbcType=VARCHAR},
  97. </if>
  98. <if test="taskForm.updateBy!=null">#{taskForm.updateBy,jdbcType=VARCHAR},
  99. </if>
  100. <if test="taskForm.dateCreate!=null">#{taskForm.dateCreate,jdbcType=TIMESTAMP},
  101. </if>
  102. <if test="taskForm.dateUpdate!=null">#{taskForm.dateUpdate,jdbcType=TIMESTAMP},
  103. </if>
  104. </trim>
  105. </insert>
  106. <!--auto generated Code-->
  107. <insert id="insertList">
  108. INSERT INTO sc_task_form (
  109. id,
  110. site_id,
  111. form_name,
  112. form_key,
  113. form_content,
  114. form_category,
  115. status,
  116. create_by,
  117. update_by,
  118. date_create,
  119. date_update
  120. )VALUES
  121. <foreach collection="taskForms" item="taskForm" index="index" separator=",">
  122. (
  123. #{taskForm.id,jdbcType=INTEGER},
  124. #{taskForm.siteId,jdbcType=INTEGER},
  125. #{taskForm.formName,jdbcType=VARCHAR},
  126. #{taskForm.formKey,jdbcType=VARCHAR},
  127. #{taskForm.formContent,jdbcType=VARCHAR},
  128. #{taskForm.formCategory,jdbcType=VARCHAR},
  129. #{taskForm.status,jdbcType=INTEGER},
  130. #{taskForm.createBy,jdbcType=VARCHAR},
  131. #{taskForm.updateBy,jdbcType=VARCHAR},
  132. #{taskForm.dateCreate,jdbcType=TIMESTAMP},
  133. #{taskForm.dateUpdate,jdbcType=TIMESTAMP}
  134. )
  135. </foreach>
  136. </insert>
  137. <!--auto generated Code-->
  138. <update id="updateByPrimaryKeySelective">
  139. UPDATE sc_task_form
  140. <set>
  141. <if test="taskForm.siteId != null"> site_id= #{taskForm.siteId,jdbcType=INTEGER},</if>
  142. <if test="taskForm.formName != null"> form_name= #{taskForm.formName,jdbcType=VARCHAR},</if>
  143. <if test="taskForm.formKey != null"> form_key= #{taskForm.formKey,jdbcType=VARCHAR},</if>
  144. <if test="taskForm.formContent != null"> form_content= #{taskForm.formContent,jdbcType=VARCHAR},</if>
  145. <if test="taskForm.formCategory != null"> form_category= #{taskForm.formCategory,jdbcType=VARCHAR},</if>
  146. <if test="taskForm.status != null"> status= #{taskForm.status,jdbcType=INTEGER},</if>
  147. <if test="taskForm.createBy != null"> create_by= #{taskForm.createBy,jdbcType=VARCHAR},</if>
  148. <if test="taskForm.updateBy != null"> update_by= #{taskForm.updateBy,jdbcType=VARCHAR},</if>
  149. <if test="taskForm.dateCreate != null"> date_create= #{taskForm.dateCreate,jdbcType=TIMESTAMP},</if>
  150. <if test="taskForm.dateUpdate != null"> date_update= #{taskForm.dateUpdate,jdbcType=TIMESTAMP}</if>
  151. </set>
  152. WHERE id = #{taskForm.id,jdbcType=INTEGER}
  153. </update>
  154. <select id="singleQuery" resultType="com.bz.smart_city.entity.TaskForm">
  155. select
  156. *
  157. from
  158. sc_task_form
  159. where status = 1
  160. <if test="taskForm.id!=null">
  161. and id = #{taskForm.id,jdbcType=INTEGER}
  162. </if>
  163. <if test="taskForm.siteId!=null">
  164. and site_id = #{taskForm.siteId,jdbcType=INTEGER}
  165. </if>
  166. <if test="taskForm.clientType!=null">
  167. and client_type = #{taskForm.clientType,jdbcType=VARCHAR}
  168. </if>
  169. <if test="taskForm.formName!=null">
  170. and form_name = #{taskForm.formName,jdbcType=VARCHAR}
  171. </if>
  172. <if test="taskForm.formKey!=null">
  173. and form_key = #{taskForm.formKey,jdbcType=VARCHAR}
  174. </if>
  175. limit 1
  176. </select>
  177. </mapper>