mitao
2024-04-08 ba421d977e745d18a6264353c739bcaaf44c40d6
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
<?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.TbBasicDataConfigMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ruoyi.system.domain.TbBasicDataConfig">
        <id column="id" property="id"/>
        <result column="basic_data_category_id" property="basicDataCategoryId"/>
        <result column="type_name" property="typeName"/>
        <result column="field_description" property="fieldDescription"/>
        <result column="calculate_type" property="calculateType"/>
        <result column="number_calculate_formula" property="numberCalculateFormula"/>
        <result column="field_id_str" property="fieldIdStr"/>
        <result column="status" property="status"/>
        <result column="del_flag" property="delFlag"/>
        <result column="create_by" property="createBy"/>
        <result column="create_time" property="createTime"/>
        <result column="update_by" property="updateBy"/>
        <result column="update_time" property="updateTime"/>
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, basic_data_category_id, type_name, field_description, calculate_type, number_calculate_formula, field_id_str, status, del_flag, create_by, create_time, update_by, update_time
    </sql>
    <select id="scoreCalculatePage" resultType="com.ruoyi.system.vo.ScoreCalculateVO">
        SELECT tdc.id,
        tdc.type_name,
        tdc.calculate_type
        FROM tb_score ts
        LEFT JOIN tb_basic_data tbd ON ts.basic_data_id = tbd.id
        LEFT JOIN tb_basic_data_config tdc ON ts.basic_data_config_id = tdc.id
        <where>
            tbd.`quarter` = #{query.quarter}
            <if test="query.typeName !=null and query.typeName != ''">
                AND tdc.type_name LIKE CONCAT('%',#{query.typeName},'%')
            </if>
            <if test="query.type !=null">
                AND tdc.calculate_type LIKE CONCAT('%',#{query.type},'%')
            </if>
        </where>
        GROUP BY tdc.type_name
    </select>
 
</mapper>