Files
xservice-script/script/src/main/resources/mapper/xb/XBFundMapper.xml
2025-10-06 10:45:01 +08:00

62 lines
2.5 KiB
XML

<?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.xiang.xservice.application.script.xb.repository.XBFundMapper">
<resultMap id="BaseResultMap" type="com.xiang.xservice.application.script.xb.entity.pojo.xb.FundInfo" >
<result column="id" property="id"/>
<result column="code" property="code" />
<result column="name" property="name" />
<result column="change" property="change" />
<result column="update_time" property="updateTime" />
</resultMap>
<resultMap id="XbFundListMap" type="com.xiang.xservice.application.script.xb.entity.pojo.xb.XbFundList">
<result column="id" property="id"/>
<result column="code" property="code" />
<result column="name" property="name" />
<result column="status" property="status" />
<result column="type" property="type" />
</resultMap>
<sql id="Base_Column_List">
id, code,
name,
`change`,
update_time
</sql>
<insert id="batchSave">
insert into xb_fund_info(code, name, `change`, update_time) values
<foreach collection="list" item="item" separator=",">
(#{item.code}, #{item.name}, #{item.change}, #{item.updateTime})
</foreach>
</insert>
<insert id="addCounts">
insert into xb_fund_count(l_id, code, name, `change`, update_time) values
<foreach collection="list" item="item" separator=",">
(#{item.lId}, #{item.code}, #{item.name}, #{item.change}, #{item.updateTime})
</foreach>
</insert>
<select id="queryListIn2Min" resultMap="BaseResultMap">
select <include refid="Base_Column_List"/>
from xb_fund_info
where update_time >= NOW() - INTERVAL 3 MINUTE
order by update_time desc
</select>
<select id="queryFundList" resultMap="XbFundListMap" parameterType="Integer">
select * from xb_fund_list
where status = 1
<if test="type != null">
and type = #{type}
</if>
</select>
<select id="queryFundInWeek" resultType="com.xiang.xservice.application.script.xb.entity.pojo.xb.XbFundCount">
select * from xb_fund_count
where update_time between NOW() - INTERVAL 7 DAY and NOW()
</select>
<select id="queryAllFundList" resultMap="XbFundListMap" parameterType="Integer">
select * from xb_fund_list where 1=1
</select>
</mapper>