1
zj
2024-06-13 8eea5be3b36875bd4ffe70e6c3a5bb07b1d829bf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?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.yami.trading.dao.future.ProfitLossConfigMapper">
 
    <sql id="profitLossConfigColumns">
        a.uuid AS "uuid",
        a.symbol_type AS "symbolType",
        a.party_id AS "partyId",
        a.remark AS "remark",
        a.type AS "type",
        a.create_by AS "createBy",
        a.update_by AS "updateBy",
        a.update_time AS "updateTime",
        a.del_flag AS "delFlag",
        a.create_time_ts AS "createTimeTs",
        a.update_time_ts AS "updateTimeTs"
 
    </sql>
 
    <sql id="profitLossConfigJoins">
 
    </sql>
 
 
 
    <select id="findById" resultType="com.yami.trading.bean.future.dto.ProfitLossConfigDTO">
        SELECT
            <include refid="profitLossConfigColumns"/>
        FROM t_profit_loss_config a
        <include refid="profitLossConfigJoins"/>
        WHERE a.uuid = #{id} and a.del_flag = 0
    </select>
 
    <select id="findList" resultType="com.yami.trading.bean.future.dto.ProfitLossConfigDTO">
        SELECT
            <include refid="profitLossConfigColumns"/>
        FROM t_profit_loss_config a
        <include refid="profitLossConfigJoins"/>
        ${ew.customSqlSegment}
    </select>
 
 
    <!--代理商逻辑 todo -->
    <select id="listRecord" resultType="com.yami.trading.bean.future.dto.ProfitLossConfigDTO" >
        select * from t_profit_loss_config a
        left join tz_user b on a.party_id = b.user_id
        <where>
            <if test="query.children != null and query.children.size() >0">
                AND a.party_id in
                <foreach collection="query.children" item="item" index="index" open="(" close=")" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="query.symbolType != null and query.symbolType !=''">
                AND a.symbol_type = #{query.symbolType}
            </if>
        <if test="query.userName!=null and query.userName!=''">
            AND  (b.user_name like CONCAT('%', #{query.userName}, '%') or b.user_code like CONCAT('%', #{query.userName}, '%'))
        </if>
            and a.del_flag = 0
        </where>
        order by a.create_time desc
    </select>
</mapper>