BmProjectInfoMapper.xml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.ruoyi.system.mapper.project.BmProjectInfoMapper">
  6. <resultMap type="BmProjectInfo" id="BmProjectInfoResult">
  7. <result property="id" column="id" />
  8. <result property="bmProjectId" column="bm_project_id" />
  9. <result property="createBy" column="create_by" />
  10. <result property="createTime" column="create_time" />
  11. <result property="updateBy" column="update_by" />
  12. <result property="updateTime" column="update_time" />
  13. <result property="name" column="name" />
  14. <result property="isDel" column="is_del" />
  15. <result property="contactor" column="contactor" />
  16. <result property="phone" column="phone" />
  17. <result property="needAmt" column="need_amt" />
  18. <result property="fixedAssets" column="fixed_assets" />
  19. <result property="productName" column="product_name" />
  20. <result property="productQty" column="product_qty" />
  21. <result property="productPrice" column="product_price" />
  22. <result property="productTax" column="product_tax" />
  23. <result property="productEmp" column="product_emp" />
  24. <result property="plannedLand" column="planned_land" />
  25. <result property="independentLand" column="independent_land" />
  26. <result property="circulationLan" column="circulation_lan" />
  27. <result property="needRoom" column="need_room" />
  28. <result property="needFactoryRoom" column="need_factory_room" />
  29. <result property="needBusRoom" column="need_bus_room" />
  30. <result property="other" column="other" />
  31. <result property="address" column="address" />
  32. <result property="isFrameorder" column="is_frameorder" />
  33. <result property="attachment" column="attachment" />
  34. <result property="description" column="description" />
  35. <collection property="referralList" javaType="java.util.List" resultMap="BmProjectReferralResult" />
  36. </resultMap>
  37. <resultMap type="BmProjectReferral" id="BmProjectReferralResult">
  38. <result property="id" column="r_id" />
  39. <result property="bmProjectId" column="r_bm_project_id" />
  40. <result property="createBy" column="r_create_by" />
  41. <result property="createTime" column="r_create_time" />
  42. <result property="updateBy" column="r_update_by" />
  43. <result property="updateTime" column="r_update_time" />
  44. <result property="isDel" column="r_is_del" />
  45. <result property="phone" column="r_phone" />
  46. <result property="sysDeptId" column="r_sys_dept_id" />
  47. <result property="investmentAllcocation" column="r_investment_allcocation" />
  48. <result property="referral" column="r_referral" />
  49. <result property="referralPhone" column="r_referral_phone" />
  50. </resultMap>
  51. <sql id="selectBmProjectInfoVo">
  52. select id, bm_project_id, create_by, create_time, update_by, update_time, name, is_del, contactor, phone, need_amt, fixed_assets, product_name, product_qty, product_price, product_tax, product_emp, planned_land, independent_land, circulation_lan, need_room, need_factory_room, need_bus_room, other, address, is_frameorder, attachment, description from bm_project_info
  53. </sql>
  54. <select id="selectBmProjectInfoList" parameterType="BmProjectInfo" resultMap="BmProjectInfoResult">
  55. <include refid="selectBmProjectInfoVo"/>
  56. <where>
  57. is_del = '0'
  58. <if test="bmProjectId != null "> and bm_project_id = #{bmProjectId}</if>
  59. <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
  60. <if test="isDel != null "> and is_del = #{isDel}</if>
  61. <if test="contactor != null and contactor != ''"> and contactor like concat('%', #{contactor}, '%')</if>
  62. <if test="phone != null and phone != ''"> and phone like concat('%', #{phone}, '%')</if>
  63. <if test="needAmt != null "> and need_amt = #{needAmt}</if>
  64. <if test="fixedAssets != null "> and fixed_assets = #{fixedAssets}</if>
  65. <if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
  66. <if test="productQty != null and productQty != ''"> and product_qty = #{productQty}</if>
  67. <if test="productPrice != null "> and product_price = #{productPrice}</if>
  68. <if test="productTax != null "> and product_tax = #{productTax}</if>
  69. <if test="productEmp != null and productEmp != ''"> and product_emp = #{productEmp}</if>
  70. <if test="plannedLand != null "> and planned_land = #{plannedLand}</if>
  71. <if test="independentLand != null "> and independent_land = #{independentLand}</if>
  72. <if test="circulationLan != null "> and circulation_lan = #{circulationLan}</if>
  73. <if test="needRoom != null "> and need_room = #{needRoom}</if>
  74. <if test="needFactoryRoom != null "> and need_factory_room = #{needFactoryRoom}</if>
  75. <if test="needBusRoom != null "> and need_bus_room = #{needBusRoom}</if>
  76. <if test="other != null and other != ''"> and other like concat('%', #{other}, '%')</if>
  77. <if test="address != null and address != ''"> and address like concat('%', #{address}, '%')</if>
  78. <if test="isFrameorder != null and isFrameorder != ''"> and is_frameorder = #{isFrameorder}</if>
  79. <if test="attachment != null and attachment != ''"> and attachment = #{attachment}</if>
  80. <if test="description != null and description != ''"> and description like concat('%', #{description}, '%')</if>
  81. </where>
  82. </select>
  83. <select id="selectBmProjectInfoById" parameterType="Long" resultMap="BmProjectInfoResult">
  84. SELECT
  85. i.id,
  86. i.bm_project_id,
  87. i.create_by,
  88. i.create_time,
  89. i.update_by,
  90. i.update_time,
  91. i.NAME,
  92. i.is_del,
  93. i.contactor,
  94. i.phone,
  95. i.need_amt,
  96. i.fixed_assets,
  97. i.product_name,
  98. i.product_qty,
  99. i.product_price,
  100. i.product_tax,
  101. i.product_emp,
  102. i.planned_land,
  103. i.independent_land,
  104. i.circulation_lan,
  105. i.need_room,
  106. i.need_factory_room,
  107. i.need_bus_room,
  108. i.other,
  109. i.address,
  110. i.is_frameorder,
  111. i.attachment,
  112. i.description,
  113. r.id as r_id,
  114. r.bm_project_id as r_bm_project_id,
  115. r.create_by as r_create_by,
  116. r.create_time as r_create_time,
  117. r.update_by as r_update_by,
  118. r.update_time as r_update_time,
  119. r.is_del as r_is_del,
  120. r.phone as r_phone,
  121. r.sys_dept_id as r_sys_dept_id,
  122. r.investment_allcocation as r_investment_allcocation,
  123. r.referral as r_referral,
  124. r.referral_phone as r_referral_phone
  125. FROM
  126. bm_project_info i
  127. LEFT JOIN bm_project_referral r ON i.bm_project_id = r.bm_project_id
  128. AND i.is_del = '0'
  129. where i.bm_project_id = #{id}
  130. </select>
  131. <insert id="insertBmProjectInfo" parameterType="BmProjectInfo" useGeneratedKeys="true" keyProperty="id">
  132. insert ignore into bm_project_info
  133. <trim prefix="(" suffix=")" suffixOverrides=",">
  134. <if test="bmProjectId != null">bm_project_id,</if>
  135. <if test="createBy != null">create_by,</if>
  136. <if test="createTime != null">create_time,</if>
  137. <if test="updateBy != null">update_by,</if>
  138. <if test="updateTime != null">update_time,</if>
  139. <if test="name != null">name,</if>
  140. <if test="isDel != null">is_del,</if>
  141. <if test="contactor != null">contactor,</if>
  142. <if test="phone != null">phone,</if>
  143. <if test="needAmt != null">need_amt,</if>
  144. <if test="fixedAssets != null">fixed_assets,</if>
  145. <if test="productName != null">product_name,</if>
  146. <if test="productQty != null">product_qty,</if>
  147. <if test="productPrice != null">product_price,</if>
  148. <if test="productTax != null">product_tax,</if>
  149. <if test="productEmp != null">product_emp,</if>
  150. <if test="plannedLand != null">planned_land,</if>
  151. <if test="independentLand != null">independent_land,</if>
  152. <if test="circulationLan != null">circulation_lan,</if>
  153. <if test="needRoom != null">need_room,</if>
  154. <if test="needFactoryRoom != null">need_factory_room,</if>
  155. <if test="needBusRoom != null">need_bus_room,</if>
  156. <if test="other != null">other,</if>
  157. <if test="address != null">address,</if>
  158. <if test="isFrameorder != null">is_frameorder,</if>
  159. <if test="attachment != null">attachment,</if>
  160. <if test="description != null">description,</if>
  161. </trim>
  162. <trim prefix="values (" suffix=")" suffixOverrides=",">
  163. <if test="bmProjectId != null">#{bmProjectId},</if>
  164. <if test="createBy != null">#{createBy},</if>
  165. <if test="createTime != null">#{createTime},</if>
  166. <if test="updateBy != null">#{updateBy},</if>
  167. <if test="updateTime != null">#{updateTime},</if>
  168. <if test="name != null">#{name},</if>
  169. <if test="isDel != null">#{isDel},</if>
  170. <if test="contactor != null">#{contactor},</if>
  171. <if test="phone != null">#{phone},</if>
  172. <if test="needAmt != null">#{needAmt},</if>
  173. <if test="fixedAssets != null">#{fixedAssets},</if>
  174. <if test="productName != null">#{productName},</if>
  175. <if test="productQty != null">#{productQty},</if>
  176. <if test="productPrice != null">#{productPrice},</if>
  177. <if test="productTax != null">#{productTax},</if>
  178. <if test="productEmp != null">#{productEmp},</if>
  179. <if test="plannedLand != null">#{plannedLand},</if>
  180. <if test="independentLand != null">#{independentLand},</if>
  181. <if test="circulationLan != null">#{circulationLan},</if>
  182. <if test="needRoom != null">#{needRoom},</if>
  183. <if test="needFactoryRoom != null">#{needFactoryRoom},</if>
  184. <if test="needBusRoom != null">#{needBusRoom},</if>
  185. <if test="other != null">#{other},</if>
  186. <if test="address != null">#{address},</if>
  187. <if test="isFrameorder != null">#{isFrameorder},</if>
  188. <if test="attachment != null">#{attachment},</if>
  189. <if test="description != null">#{description},</if>
  190. </trim>
  191. </insert>
  192. <update id="updateBmProjectInfo" parameterType="BmProjectInfo">
  193. update bm_project_info
  194. <trim prefix="SET" suffixOverrides=",">
  195. <if test="bmProjectId != null">bm_project_id = #{bmProjectId},</if>
  196. <if test="createBy != null">create_by = #{createBy},</if>
  197. <if test="createTime != null">create_time = #{createTime},</if>
  198. <if test="updateBy != null">update_by = #{updateBy},</if>
  199. <if test="updateTime != null">update_time = #{updateTime},</if>
  200. <if test="name != null">name = #{name},</if>
  201. <if test="isDel != null">is_del = #{isDel},</if>
  202. <if test="contactor != null">contactor = #{contactor},</if>
  203. <if test="phone != null">phone = #{phone},</if>
  204. <if test="needAmt != null">need_amt = #{needAmt},</if>
  205. <if test="fixedAssets != null">fixed_assets = #{fixedAssets},</if>
  206. <if test="productName != null">product_name = #{productName},</if>
  207. <if test="productQty != null">product_qty = #{productQty},</if>
  208. <if test="productPrice != null">product_price = #{productPrice},</if>
  209. <if test="productTax != null">product_tax = #{productTax},</if>
  210. <if test="productEmp != null">product_emp = #{productEmp},</if>
  211. <if test="plannedLand != null">planned_land = #{plannedLand},</if>
  212. <if test="independentLand != null">independent_land = #{independentLand},</if>
  213. <if test="circulationLan != null">circulation_lan = #{circulationLan},</if>
  214. <if test="needRoom != null">need_room = #{needRoom},</if>
  215. <if test="needFactoryRoom != null">need_factory_room = #{needFactoryRoom},</if>
  216. <if test="needBusRoom != null">need_bus_room = #{needBusRoom},</if>
  217. <if test="other != null">other = #{other},</if>
  218. <if test="address != null">address = #{address},</if>
  219. <if test="isFrameorder != null">is_frameorder = #{isFrameorder},</if>
  220. <if test="attachment != null">attachment = #{attachment},</if>
  221. <if test="description != null">description = #{description},</if>
  222. </trim>
  223. where id = #{id}
  224. </update>
  225. <!-- <delete id="deleteBmProjectInfoById" parameterType="Long">
  226. delete from bm_project_info where id = #{id}
  227. </delete>-->
  228. <update id="deleteBmProjectInfoById" parameterType="Long">
  229. update bm_project_info set id_del = '1' where id = #{id}
  230. </update>
  231. <!-- <delete id="deleteBmProjectInfoByIds" parameterType="String">
  232. delete from bm_project_info where id in
  233. <foreach item="id" collection="array" open="(" separator="," close=")">
  234. #{id}
  235. </foreach>
  236. </delete>-->
  237. <update id="deleteBmProjectInfoByIds" parameterType="String">
  238. update bm_project_info set id_del = '1' where id in
  239. <foreach item="id" collection="array" open="(" separator="," close=")">
  240. #{id}
  241. </foreach>
  242. </update>
  243. </mapper>