fix: 项目列表查询
This commit is contained in:
@@ -15,9 +15,64 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="queryList" resultType="org.agt.module.license.controller.admin.project.vo.ProjectRespVO">
|
<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>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
<sql id="queryProjects">
|
<sql id="queryProjects">
|
||||||
SELECT
|
SELECT
|
||||||
p.*
|
p.*
|
||||||
@@ -48,6 +103,7 @@
|
|||||||
WHERE
|
WHERE
|
||||||
p.deleted = 0
|
p.deleted = 0
|
||||||
) p
|
) p
|
||||||
|
<where>
|
||||||
<if test="query.customerId != null">
|
<if test="query.customerId != null">
|
||||||
AND p.customer_id = #{query.customerId}
|
AND p.customer_id = #{query.customerId}
|
||||||
</if>
|
</if>
|
||||||
@@ -92,6 +148,7 @@
|
|||||||
OR p.technical_owner_b = #{query.technicalOwner}
|
OR p.technical_owner_b = #{query.technicalOwner}
|
||||||
OR p.technical_owner_c = #{query.technicalOwner})
|
OR p.technical_owner_c = #{query.technicalOwner})
|
||||||
</if>
|
</if>
|
||||||
|
</where>
|
||||||
<choose>
|
<choose>
|
||||||
<when test="query.sortField != null and query.sortField != '' and query.sortOrder != null and query.sortOrder != ''">
|
<when test="query.sortField != null and query.sortField != '' and query.sortOrder != null and query.sortOrder != ''">
|
||||||
ORDER BY
|
ORDER BY
|
||||||
@@ -102,7 +159,6 @@
|
|||||||
p.create_time DESC
|
p.create_time DESC
|
||||||
</otherwise>
|
</otherwise>
|
||||||
</choose>
|
</choose>
|
||||||
|
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="getLicenseProjects" resultType="org.agt.module.license.controller.admin.project.vo.ProjectRespVO">
|
<select id="getLicenseProjects" resultType="org.agt.module.license.controller.admin.project.vo.ProjectRespVO">
|
||||||
|
|||||||
Reference in New Issue
Block a user