电速宝智配引擎
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SchemeInvestmentMapper.xml 4.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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.SchemeInvestmentMapper">
  6. <resultMap type="SchemeInvestment" id="SchemeInvestmentResult">
  7. <id property="id" column="id"/>
  8. <result property="schemeId" column="scheme_id"/>
  9. <result property="totalInvestment" column="total_investment"/>
  10. <result property="investmentScale" column="investment_scale"/>
  11. <result property="revenueForecast" column="revenue_forecast"/>
  12. <result property="revenueModel" column="revenue_model"/>
  13. <result property="createBy" column="create_by"/>
  14. <result property="createTime" column="create_time"/>
  15. <result property="updateBy" column="update_by"/>
  16. <result property="updateTime" column="update_time"/>
  17. </resultMap>
  18. <sql id="selectSchemeInvestmentVo">
  19. select id, scheme_id, total_investment, investment_scale,revenue_forecast, revenue_model,
  20. create_by, create_time, update_by, update_time
  21. from scheme_investment
  22. </sql>
  23. <select id="selectSchemeInvestmentList" parameterType="SchemeInvestment" resultMap="SchemeInvestmentResult">
  24. <include refid="selectSchemeInvestmentVo"/>
  25. <where>
  26. <if test="schemeId != null and schemeId != ''">
  27. AND scheme_id = #{schemeId}
  28. </if>
  29. <if test="params.beginTime != null and params.beginTime != ''">
  30. and date_format(create_time,'%Y%m%d') &gt;= date_format(#{params.beginTime},'%Y%m%d')
  31. </if>
  32. <if test="params.endTime != null and params.endTime != ''">
  33. and date_format(create_time,'%Y%m%d') &lt;= date_format(#{params.endTime},'%Y%m%d')
  34. </if>
  35. </where>
  36. </select>
  37. <select id="selectSchemeInvestmentById" parameterType="Long" resultMap="SchemeInvestmentResult">
  38. <include refid="selectSchemeInvestmentVo"/>
  39. where id = #{id}
  40. </select>
  41. <select id="selectSchemeInvestmentBySchemeId" parameterType="String" resultMap="SchemeInvestmentResult">
  42. <include refid="selectSchemeInvestmentVo"/>
  43. where scheme_id = #{schemeId}
  44. </select>
  45. <insert id="insertSchemeInvestment" parameterType="SchemeInvestment">
  46. insert into scheme_investment (
  47. <if test="schemeId != null and schemeId != ''">scheme_id,</if>
  48. <if test="totalInvestment != null and totalInvestment != ''">total_investment,</if>
  49. <if test="investmentScale != null and investmentScale != ''">investment_scale,</if>
  50. <if test="revenueForecast != null and revenueForecast != ''">revenue_forecast,</if>
  51. <if test="revenueModel != null and revenueModel != ''">revenue_model,</if>
  52. <if test="createBy != null">create_by,</if>
  53. create_time
  54. )values(
  55. <if test="schemeId != null and schemeId != ''">#{schemeId},</if>
  56. <if test="totalInvestment != null and totalInvestment != ''">#{totalInvestment},</if>
  57. <if test="investmentScale != null and investmentScale != ''">#{investment_scale},</if>
  58. <if test="revenueForecast != null and revenueForecast != ''">#{revenueForecast},</if>
  59. <if test="revenueModel != null and revenueModel != ''">#{revenueModel},</if>
  60. <if test="createBy != null">#{createBy},</if>
  61. sysdate()
  62. )
  63. </insert>
  64. <update id="updateSchemeInvestment" parameterType="SchemeInvestment">
  65. update scheme_investment
  66. <set>
  67. <if test="schemeId != null and schemeId != ''">scheme_id = #{schemeId},</if>
  68. <if test="totalInvestment != null and totalInvestment != ''">total_investment = #{totalInvestment},</if>
  69. <if test="investmentScale != null and investmentScale != ''">investment_scale = #{investmentScale},</if>
  70. <if test="revenueForecast != null and revenueForecast != ''">revenue_forecast = #{revenueForecast},</if>
  71. <if test="revenueModel != null and revenueModel != ''">revenue_model = #{revenueModel},</if>
  72. <if test="updateBy != null">update_by = #{updateBy},</if>
  73. update_time = sysdate()
  74. </set>
  75. where scheme_id = #{schemeId}
  76. </update>
  77. <delete id="deleteSchemeInvestmentById" parameterType="String">
  78. delete from scheme_investment where scheme_id = #{schemeId}
  79. </delete>
  80. <delete id="deleteSchemeInvestmentByIds" parameterType="Long">
  81. delete from scheme_investment where id in
  82. <foreach item="id" collection="array" open="(" separator="," close=")">
  83. #{id}
  84. </foreach>
  85. </delete>
  86. </mapper>