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.
101 lines
5.1 KiB
101 lines
5.1 KiB
<?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.booksystem.mapper.StatisticsRemainMapper">
|
|
|
|
<resultMap type="StatisticsRemain" id="StatisticsRemainResult">
|
|
<result property="id" column="id" />
|
|
<result property="code" column="code" />
|
|
<result property="name" column="name" />
|
|
<result property="tradeDay" column="trade_day" />
|
|
<result property="weekDay" column="week_day" />
|
|
<result property="totalProfit" column="total_profit" />
|
|
<result property="totalDiff" column="total_diff" />
|
|
<result property="totalDiffOverall" column="total_diff_overall" />
|
|
<result property="remaining" column="remaining" />
|
|
<result property="userId" column="user_id" />
|
|
<result property="bz" column="bz" />
|
|
</resultMap>
|
|
|
|
<sql id="selectStatisticsRemainVo">
|
|
select id, code, name, trade_day, week_day, total_profit, total_diff, total_diff_overall, remaining, user_id, bz from statistics_remain
|
|
</sql>
|
|
|
|
<select id="selectStatisticsRemainList" parameterType="StatisticsRemain" resultMap="StatisticsRemainResult">
|
|
<include refid="selectStatisticsRemainVo"/>
|
|
<where>
|
|
<if test="code != null and code != ''"> and code = #{code}</if>
|
|
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
|
<if test="tradeDay != null "> and trade_day = #{tradeDay}</if>
|
|
<if test="weekDay != null "> and week_day = #{weekDay}</if>
|
|
<if test="totalProfit != null "> and total_profit = #{totalProfit}</if>
|
|
<if test="totalDiff != null "> and total_diff = #{totalDiff}</if>
|
|
<if test="totalDiffOverall != null "> and total_diff_overall = #{totalDiffOverall}</if>
|
|
<if test="remaining != null "> and remaining = #{remaining}</if>
|
|
<if test="userId != null "> and user_id = #{userId}</if>
|
|
<if test="bz != null and bz != ''"> and bz = #{bz}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectStatisticsRemainById" parameterType="Long" resultMap="StatisticsRemainResult">
|
|
<include refid="selectStatisticsRemainVo"/>
|
|
where id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertStatisticsRemain" parameterType="StatisticsRemain" useGeneratedKeys="true" keyProperty="id">
|
|
insert into statistics_remain
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="code != null and code != ''">code,</if>
|
|
<if test="name != null">name,</if>
|
|
<if test="tradeDay != null">trade_day,</if>
|
|
<if test="weekDay != null">week_day,</if>
|
|
<if test="totalProfit != null">total_profit,</if>
|
|
<if test="totalDiff != null">total_diff,</if>
|
|
<if test="totalDiffOverall != null">total_diff_overall,</if>
|
|
<if test="remaining != null">remaining,</if>
|
|
<if test="userId != null">user_id,</if>
|
|
<if test="bz != null">bz,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="code != null and code != ''">#{code},</if>
|
|
<if test="name != null">#{name},</if>
|
|
<if test="tradeDay != null">#{tradeDay},</if>
|
|
<if test="weekDay != null">#{weekDay},</if>
|
|
<if test="totalProfit != null">#{totalProfit},</if>
|
|
<if test="totalDiff != null">#{totalDiff},</if>
|
|
<if test="totalDiffOverall != null">#{totalDiffOverall},</if>
|
|
<if test="remaining != null">#{remaining},</if>
|
|
<if test="userId != null">#{userId},</if>
|
|
<if test="bz != null">#{bz},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateStatisticsRemain" parameterType="StatisticsRemain">
|
|
update statistics_remain
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="code != null and code != ''">code = #{code},</if>
|
|
<if test="name != null">name = #{name},</if>
|
|
<if test="tradeDay != null">trade_day = #{tradeDay},</if>
|
|
<if test="weekDay != null">week_day = #{weekDay},</if>
|
|
<if test="totalProfit != null">total_profit = #{totalProfit},</if>
|
|
<if test="totalDiff != null">total_diff = #{totalDiff},</if>
|
|
<if test="totalDiffOverall != null">total_diff_overall = #{totalDiffOverall},</if>
|
|
<if test="remaining != null">remaining = #{remaining},</if>
|
|
<if test="userId != null">user_id = #{userId},</if>
|
|
<if test="bz != null">bz = #{bz},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteStatisticsRemainById" parameterType="Long">
|
|
delete from statistics_remain where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteStatisticsRemainByIds" parameterType="String">
|
|
delete from statistics_remain where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
</mapper> |