mitao
3 天以前 56efd0aa54e2c5cea81ff9b28855bca520dee475
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
<?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.YearTaskMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ruoyi.system.model.YearTask">
        <id column="id" property="id" />
        <result column="year" property="year" />
        <result column="project_id" property="projectId" />
        <result column="target" property="target" />
        <result column="create_time" property="createTime" />
        <result column="create_by" property="createBy" />
        <result column="update_time" property="updateTime" />
        <result column="update_by" property="updateBy" />
        <result column="disabled" property="disabled" />
        <result column="total_amount" property="totalAmount" />
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, year, project_id, target, create_time, create_by, update_time, update_by, disabled, total_amount
    </sql>
    <select id="pageList" resultType="com.ruoyi.system.vo.YearTaskListVO">
        select t1.*,t2.project_name as projectName from year_task t1
        left join project_main t2 on t1.project_id = t2.id
        where 1=1
        <if test="query.year != null and query.year != ''">
            and t1.year = #{query.year}
        </if>
        <if test="query.projectName != null and query.projectName != ''">
            and t2.project_name like concat('%',#{query.projectName},'%')
        </if>
 
    </select>
 
</mapper>