PlanMapper.xml 7.0 KB

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