<?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.nq.dao.FundsLeverMapper">
|
|
<resultMap id="BaseResultMap" type="com.nq.pojo.FundsLever" >
|
<result column="id" property="id" />
|
<result column="cycle_type" property="cycleType" />
|
<result column="lever" property="lever" />
|
<result column="manage_rate" property="manageRate" />
|
<result column="single_holding_ratio" property="singleHoldingRatio" />
|
<result column="status" property="status" />
|
<result column="add_time" property="addTime" />
|
<result column="update_time" property="updateTime" />
|
</resultMap>
|
|
<sql id="Base_Column_List">
|
id,
|
cycle_type,
|
lever,
|
manage_rate,
|
single_holding_ratio,
|
status,
|
add_time,
|
update_time
|
</sql>
|
|
<insert id="insert" useGeneratedKeys="true" keyColumn="id" keyProperty="id" parameterType="com.nq.pojo.FundsLever">
|
INSERT INTO funds_lever
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test ='null != cycleType'>
|
cycle_type,
|
</if>
|
<if test ='null != lever'>
|
lever,
|
</if>
|
<if test ='null != manageRate'>
|
manage_rate,
|
</if>
|
<if test ='null != singleHoldingRatio'>
|
single_holding_ratio,
|
</if>
|
<if test ='null != status'>
|
status,
|
</if>
|
<if test ='null != addTime'>
|
add_time,
|
</if>
|
<if test ='null != updateTime'>
|
update_time
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test ='null != cycleType'>
|
#{cycleType},
|
</if>
|
<if test ='null != lever'>
|
#{lever},
|
</if>
|
<if test ='null != manageRate'>
|
#{manageRate},
|
</if>
|
<if test ='null != singleHoldingRatio'>
|
#{singleHoldingRatio},
|
</if>
|
<if test ='null != status'>
|
#{status},
|
</if>
|
<if test ='null != addTime'>
|
#{addTime},
|
</if>
|
<if test ='null != updateTime'>
|
#{updateTime}
|
</if>
|
</trim>
|
</insert>
|
|
<delete id="delete" >
|
DELETE FROM funds_lever
|
WHERE id = #{id}
|
</delete>
|
|
<update id="update" parameterType="com.nq.pojo.FundsLever">
|
UPDATE funds_lever
|
<set>
|
<if test ='null != cycleType'>cycle_type = #{cycleType},</if>
|
<if test ='null != lever'>lever = #{lever},</if>
|
<if test ='null != manageRate'>manage_rate = #{manageRate},</if>
|
<if test ='null != singleHoldingRatio'>single_holding_ratio = #{singleHoldingRatio},</if>
|
<if test ='null != status'>status = #{status},</if>
|
<if test ='null != addTime'>add_time = #{addTime},</if>
|
<if test ='null != updateTime'>update_time = #{updateTime}</if>
|
</set>
|
WHERE id = #{id}
|
</update>
|
|
|
<select id="load" resultMap="BaseResultMap">
|
SELECT <include refid="Base_Column_List" />
|
FROM funds_lever
|
WHERE id = #{id}
|
</select>
|
|
<select id="pageList" resultMap="BaseResultMap">
|
SELECT <include refid="Base_Column_List" />
|
FROM funds_lever
|
order by cycle_type asc,lever asc
|
</select>
|
|
<select id="pageListCount" resultType="java.lang.Integer">
|
SELECT count(1)
|
FROM funds_lever
|
</select>
|
|
<!--查询配资类型杠杆-->
|
<select id="getFundsTypeList" resultMap="BaseResultMap">
|
SELECT <include refid="Base_Column_List" />
|
FROM funds_lever
|
where status =1
|
and cycle_type = #{cycleType}
|
order by cycle_type asc,lever asc
|
</select>
|
|
<!--查询杠杆费率-->
|
<select id="getLeverRateInfo" resultMap="BaseResultMap">
|
SELECT <include refid="Base_Column_List" />
|
FROM funds_lever
|
WHERE lever = #{lever} and cycle_type = #{cycleType}
|
limit 1
|
</select>
|
|
</mapper>
|