znpt-backend/core/src/main/resources/mapper/ProjectBudgetInfoMapper.xml

50 lines
2.1 KiB
XML
Raw Normal View History

<?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.dite.znpt.mapper.ProjectBudgetInfoMapper">
<sql id="Base_Column_List">
a.budget_id, a.project_id, a.budget_name, a.budget_type,
a.budget_amount, a.budget_desc, a.update_by, a.create_time,
a.create_by, a.update_time
</sql>
<select id="queryBySelective" resultType="com.dite.znpt.domain.vo.ProjectBudgetInfoListResp">
select
<include refid="Base_Column_List"/>, p.*
from project_budget_info a
left join project p on a.project_id = p.project_id
<where>
<if test="budgetId != null and budgetId != ''">
and a.budget_id like concat ('%', #{budgetId}, '%')
</if>
<if test="projectId != null and projectId != ''">
and a.project_id like concat ('%', #{projectId}, '%')
</if>
<if test="budgetName != null and budgetName != ''">
and a.budget_name like concat ('%', #{budgetName}, '%')
</if>
<if test="budgetType != null and budgetType != ''">
and a.budget_type like concat ('%', #{budgetType}, '%')
</if>
<if test="budgetAmount != null">
and a.budget_amount = #{budgetAmount}
</if>
<if test="budgetDesc != null and budgetDesc != ''">
and a.budget_desc like concat ('%', #{budgetDesc}, '%')
</if>
</where>
</select>
<select id="detailByProjectId" resultType="com.dite.znpt.domain.vo.ProjectBudgetInfoResp">
select
<include refid="Base_Column_List"/>
from project_budget_info a
<where>
<if test="_parameter != null and _parameter != ''">
and a.project_id like concat ('%', #{projectId}, '%')
</if>
</where>
</select>
</mapper>