| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.ruoyi.system.mapper.SchemeInvestmentMapper">
-
- <resultMap type="SchemeInvestment" id="SchemeInvestmentResult">
- <id property="id" column="id"/>
- <result property="schemeId" column="scheme_id"/>
- <result property="totalInvestment" column="total_investment"/>
- <result property="investmentScale" column="investment_scale"/>
- <result property="revenueForecast" column="revenue_forecast"/>
- <result property="revenueModel" column="revenue_model"/>
- <result property="createBy" column="create_by"/>
- <result property="createTime" column="create_time"/>
- <result property="updateBy" column="update_by"/>
- <result property="updateTime" column="update_time"/>
- </resultMap>
-
- <sql id="selectSchemeInvestmentVo">
- select id, scheme_id, total_investment, investment_scale,revenue_forecast, revenue_model,
- create_by, create_time, update_by, update_time
- from scheme_investment
- </sql>
-
- <select id="selectSchemeInvestmentList" parameterType="SchemeInvestment" resultMap="SchemeInvestmentResult">
- <include refid="selectSchemeInvestmentVo"/>
- <where>
- <if test="schemeId != null and schemeId != ''">
- AND scheme_id = #{schemeId}
- </if>
- <if test="params.beginTime != null and params.beginTime != ''">
- and date_format(create_time,'%Y%m%d') >= date_format(#{params.beginTime},'%Y%m%d')
- </if>
- <if test="params.endTime != null and params.endTime != ''">
- and date_format(create_time,'%Y%m%d') <= date_format(#{params.endTime},'%Y%m%d')
- </if>
- </where>
- </select>
-
- <select id="selectSchemeInvestmentById" parameterType="Long" resultMap="SchemeInvestmentResult">
- <include refid="selectSchemeInvestmentVo"/>
- where id = #{id}
- </select>
-
- <select id="selectSchemeInvestmentBySchemeId" parameterType="String" resultMap="SchemeInvestmentResult">
- <include refid="selectSchemeInvestmentVo"/>
- where scheme_id = #{schemeId}
- </select>
-
- <insert id="insertSchemeInvestment" parameterType="SchemeInvestment">
- insert into scheme_investment (
- <if test="schemeId != null and schemeId != ''">scheme_id,</if>
- <if test="totalInvestment != null and totalInvestment != ''">total_investment,</if>
- <if test="investmentScale != null and investmentScale != ''">investment_scale,</if>
- <if test="revenueForecast != null and revenueForecast != ''">revenue_forecast,</if>
- <if test="revenueModel != null and revenueModel != ''">revenue_model,</if>
- <if test="createBy != null">create_by,</if>
- create_time
- )values(
- <if test="schemeId != null and schemeId != ''">#{schemeId},</if>
- <if test="totalInvestment != null and totalInvestment != ''">#{totalInvestment},</if>
- <if test="investmentScale != null and investmentScale != ''">#{investment_scale},</if>
- <if test="revenueForecast != null and revenueForecast != ''">#{revenueForecast},</if>
- <if test="revenueModel != null and revenueModel != ''">#{revenueModel},</if>
- <if test="createBy != null">#{createBy},</if>
- sysdate()
- )
- </insert>
-
- <update id="updateSchemeInvestment" parameterType="SchemeInvestment">
- update scheme_investment
- <set>
- <if test="schemeId != null and schemeId != ''">scheme_id = #{schemeId},</if>
- <if test="totalInvestment != null and totalInvestment != ''">total_investment = #{totalInvestment},</if>
- <if test="investmentScale != null and investmentScale != ''">investment_scale = #{investmentScale},</if>
- <if test="revenueForecast != null and revenueForecast != ''">revenue_forecast = #{revenueForecast},</if>
- <if test="revenueModel != null and revenueModel != ''">revenue_model = #{revenueModel},</if>
- <if test="updateBy != null">update_by = #{updateBy},</if>
- update_time = sysdate()
- </set>
- where scheme_id = #{schemeId}
- </update>
-
- <delete id="deleteSchemeInvestmentById" parameterType="String">
- delete from scheme_investment where scheme_id = #{schemeId}
- </delete>
-
- <delete id="deleteSchemeInvestmentByIds" parameterType="Long">
- delete from scheme_investment where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
-
- </mapper>
|