fix: 项目列表查询

This commit is contained in:
caiyuchao
2025-09-15 19:10:13 +08:00
parent ba404cfb39
commit 39205b51eb

View File

@@ -15,9 +15,64 @@
</select>
<select id="queryList" resultType="org.agt.module.license.controller.admin.project.vo.ProjectRespVO">
<include refid="queryProjects"></include>
SELECT
p.*,
c.serial_no
FROM
crm_project p
LEFT JOIN crm_license_server c ON p.id = c.project_id
AND c.deleted = 0
WHERE
p.deleted = 0
<if test="query.customerId != null">
AND p.customer_id = #{query.customerId}
</if>
<if test="query.name != null and query.name != ''">
AND p.name LIKE CONCAT('%',#{query.name},'%')
</if>
<if test="query.code != null and query.code != ''">
AND p.code LIKE CONCAT('%',#{query.code },'%')
</if>
<if test="query.contractCode != null and query.contractCode != ''">
AND p.contract_code LIKE CONCAT('%',#{query.contractCode},'%')
</if>
<if test="query.businessStatus != null">
AND p.business_status = #{query.businessStatus}
</if>
<if test="query.businessOwner != null">
AND p.business_owner = #{query.businessOwner}
</if>
<if test="query.customerOwner != null and query.customerOwner != ''">
AND p.customer_owner LIKE CONCAT('%',#{query.customerOwner},'%')
</if>
<if test="query.startTime != null and query.startTime.length > 1">
AND p.start_time BETWEEN #{query.startTime[0]} AND #{query.startTime[1]}
</if>
<if test="query.endTime != null and query.endTime.length > 1">
AND p.end_time BETWEEN #{query.endTime[0]} AND #{query.endTime[1]}
</if>
<if test="query.createTime != null and query.createTime.length > 1">
AND p.create_time BETWEEN #{query.createTime[0]} AND #{query.createTime[1]}
</if>
<if test="query.status != null">
AND p.status = #{query.status}
</if>
<if test="query.envInfo != null and query.envInfo != ''">
AND p.env_info LIKE CONCAT('%',#{query.envInfo},'%')
</if>
<if test="query.serialNo != null and query.serialNo != ''">
AND c.serial_no LIKE CONCAT('%',#{query.serialNo},'%')
</if>
<if test="query.technicalOwner != null">
AND (p.technical_owner_a = #{query.technicalOwner}
OR p.technical_owner_b = #{query.technicalOwner}
OR p.technical_owner_c = #{query.technicalOwner})
</if>
ORDER BY
p.create_time DESC
</select>
<sql id="queryProjects">
SELECT
p.*
@@ -48,6 +103,7 @@
WHERE
p.deleted = 0
) p
<where>
<if test="query.customerId != null">
AND p.customer_id = #{query.customerId}
</if>
@@ -92,6 +148,7 @@
OR p.technical_owner_b = #{query.technicalOwner}
OR p.technical_owner_c = #{query.technicalOwner})
</if>
</where>
<choose>
<when test="query.sortField != null and query.sortField != '' and query.sortOrder != null and query.sortOrder != ''">
ORDER BY
@@ -102,7 +159,6 @@
p.create_time DESC
</otherwise>
</choose>
</sql>
<select id="getLicenseProjects" resultType="org.agt.module.license.controller.admin.project.vo.ProjectRespVO">