|
@@ -0,0 +1,111 @@
|
|
|
+<?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.ZxInvestmentMapper">
|
|
|
+
|
|
|
+ <resultMap type="ZxInvestment" id="ZxInvestmentResult">
|
|
|
+ <result property="investmentId" column="investment_id" />
|
|
|
+ <result property="userId" column="user_id" />
|
|
|
+ <result property="name" column="name" />
|
|
|
+ <result property="clueName" column="clue_name" />
|
|
|
+ <result property="investmentAmount" column="investment_amount" />
|
|
|
+ <result property="contactsName" column="contacts_name" />
|
|
|
+ <result property="contactsPhone" column="contacts_phone" />
|
|
|
+ <result property="contactsContent" column="contacts_content" />
|
|
|
+ <result property="publishTime" column="publish_time" />
|
|
|
+ <result property="createBy" column="create_by" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="updateBy" column="update_by" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ <result property="remark" column="remark" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectZxInvestmentVo">
|
|
|
+ select investment_id, user_id, name, clue_name, investment_amount, contacts_name, contacts_phone, contacts_content, publish_time, create_by, create_time, update_by, update_time, remark from zx_investment
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectZxInvestmentList" parameterType="ZxInvestment" resultMap="ZxInvestmentResult">
|
|
|
+ <include refid="selectZxInvestmentVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="userId != null "> and user_id = #{userId}</if>
|
|
|
+ <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
|
|
+ <if test="clueName != null and clueName != ''"> and clue_name like concat('%', #{clueName}, '%')</if>
|
|
|
+ <if test="investmentAmount != null and investmentAmount != ''"> and investment_amount = #{investmentAmount}</if>
|
|
|
+ <if test="contactsName != null and contactsName != ''"> and contacts_name like concat('%', #{contactsName}, '%')</if>
|
|
|
+ <if test="contactsPhone != null and contactsPhone != ''"> and contacts_phone = #{contactsPhone}</if>
|
|
|
+ <if test="contactsContent != null and contactsContent != ''"> and contacts_content = #{contactsContent}</if>
|
|
|
+ <if test="publishTime != null "> and publish_time = #{publishTime}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectZxInvestmentByInvestmentId" parameterType="Long" resultMap="ZxInvestmentResult">
|
|
|
+ <include refid="selectZxInvestmentVo"/>
|
|
|
+ where investment_id = #{investmentId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertZxInvestment" parameterType="ZxInvestment" useGeneratedKeys="true" keyProperty="investmentId">
|
|
|
+ insert into zx_investment
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="userId != null">user_id,</if>
|
|
|
+ <if test="name != null">name,</if>
|
|
|
+ <if test="clueName != null">clue_name,</if>
|
|
|
+ <if test="investmentAmount != null">investment_amount,</if>
|
|
|
+ <if test="contactsName != null">contacts_name,</if>
|
|
|
+ <if test="contactsPhone != null">contacts_phone,</if>
|
|
|
+ <if test="contactsContent != null">contacts_content,</if>
|
|
|
+ <if test="publishTime != null">publish_time,</if>
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ <if test="remark != null">remark,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="userId != null">#{userId},</if>
|
|
|
+ <if test="name != null">#{name},</if>
|
|
|
+ <if test="clueName != null">#{clueName},</if>
|
|
|
+ <if test="investmentAmount != null">#{investmentAmount},</if>
|
|
|
+ <if test="contactsName != null">#{contactsName},</if>
|
|
|
+ <if test="contactsPhone != null">#{contactsPhone},</if>
|
|
|
+ <if test="contactsContent != null">#{contactsContent},</if>
|
|
|
+ <if test="publishTime != null">#{publishTime},</if>
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="remark != null">#{remark},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateZxInvestment" parameterType="ZxInvestment">
|
|
|
+ update zx_investment
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="userId != null">user_id = #{userId},</if>
|
|
|
+ <if test="name != null">name = #{name},</if>
|
|
|
+ <if test="clueName != null">clue_name = #{clueName},</if>
|
|
|
+ <if test="investmentAmount != null">investment_amount = #{investmentAmount},</if>
|
|
|
+ <if test="contactsName != null">contacts_name = #{contactsName},</if>
|
|
|
+ <if test="contactsPhone != null">contacts_phone = #{contactsPhone},</if>
|
|
|
+ <if test="contactsContent != null">contacts_content = #{contactsContent},</if>
|
|
|
+ <if test="publishTime != null">publish_time = #{publishTime},</if>
|
|
|
+ <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ <if test="remark != null">remark = #{remark},</if>
|
|
|
+ </trim>
|
|
|
+ where investment_id = #{investmentId}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteZxInvestmentByInvestmentId" parameterType="Long">
|
|
|
+ delete from zx_investment where investment_id = #{investmentId}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteZxInvestmentByInvestmentIds" parameterType="String">
|
|
|
+ delete from zx_investment where investment_id in
|
|
|
+ <foreach item="investmentId" collection="array" open="(" separator="," close=")">
|
|
|
+ #{investmentId}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|