Commit a4cd4349 authored by 李灿灿's avatar 李灿灿

feat:保单维护时间搜索条件优化

parent b4d73df9
...@@ -35,12 +35,18 @@ ...@@ -35,12 +35,18 @@
<if test="param.policyNo != null and param.policyNo.trim() != ''"> <if test="param.policyNo != null and param.policyNo.trim() != ''">
and POLICY_NO like concat('%',replace(replace(#{param.policyNo},'_','\_'),'%','\%'),'%') and POLICY_NO like concat('%',replace(replace(#{param.policyNo},'_','\_'),'%','\%'),'%')
</if> </if>
<if test="param.policyStart != null and param.policyStart.trim() != ''"> <if test="param.policyStart != null and param.policyStart.trim() != '' and param.policyEnd == null">
AND DATE(POLICY_START) <![CDATA[ >= ]]> #{param.policyStart} AND DATE(POLICY_START) <![CDATA[ >= ]]> #{param.policyStart}
</if> </if>
<if test="param.policyEnd != null and param.policyEnd.trim() != ''"> <if test="param.policyEnd != null and param.policyEnd.trim() != '' and param.policyStart == null">
AND DATE(POLICY_END) <![CDATA[ <= ]]> #{param.policyEnd} AND DATE(POLICY_END) <![CDATA[ <= ]]> #{param.policyEnd}
</if> </if>
<if test="param.policyStart != null and param.policyStart.trim() != '' and param.policyEnd != null and param.policyEnd.trim() != ''">
and (
(DATE(POLICY_START) <![CDATA[ >= ]]> #{param.policyStart} and DATE(POLICY_START) <![CDATA[ <= ]]> #{param.policyEnd}) OR
(DATE(POLICY_END) <![CDATA[ >= ]]> #{param.policyStart} and DATE(POLICY_END) <![CDATA[ <= ]]> #{param.policyEnd})
)
</if>
<if test="param.insuranceCompanyName != null and param.insuranceCompanyName.trim() != ''"> <if test="param.insuranceCompanyName != null and param.insuranceCompanyName.trim() != ''">
and INSURANCE_COMPANY_NAME like concat('%',replace(replace(#{param.insuranceCompanyName},'_','\_'),'%','\%'),'%') and INSURANCE_COMPANY_NAME like concat('%',replace(replace(#{param.insuranceCompanyName},'_','\_'),'%','\%'),'%')
</if> </if>
...@@ -61,12 +67,18 @@ ...@@ -61,12 +67,18 @@
<if test="param.policyNo != null and param.policyNo.trim() != ''"> <if test="param.policyNo != null and param.policyNo.trim() != ''">
and POLICY_NO like concat('%',replace(replace(#{param.policyNo},'_','\_'),'%','\%'),'%') and POLICY_NO like concat('%',replace(replace(#{param.policyNo},'_','\_'),'%','\%'),'%')
</if> </if>
<if test="param.policyStart != null and param.policyStart.trim() != ''"> <if test="param.policyStart != null and param.policyStart.trim() != '' and param.policyEnd == null">
AND DATE(POLICY_START) <![CDATA[ >= ]]> #{param.policyStart} AND DATE(POLICY_START) <![CDATA[ >= ]]> #{param.policyStart}
</if> </if>
<if test="param.policyEnd != null and param.policyEnd.trim() != ''"> <if test="param.policyEnd != null and param.policyEnd.trim() != '' and param.policyStart == null">
AND DATE(POLICY_END) <![CDATA[ <= ]]> #{param.policyEnd} AND DATE(POLICY_END) <![CDATA[ <= ]]> #{param.policyEnd}
</if> </if>
<if test="param.policyStart != null and param.policyStart.trim() != '' and param.policyEnd != null and param.policyEnd.trim() != ''">
and (
(DATE(POLICY_START) <![CDATA[ >= ]]> #{param.policyStart} and DATE(POLICY_START) <![CDATA[ <= ]]> #{param.policyEnd}) OR
(DATE(POLICY_END) <![CDATA[ >= ]]> #{param.policyStart} and DATE(POLICY_END) <![CDATA[ <= ]]> #{param.policyEnd})
)
</if>
<if test="param.insuranceCompanyName != null and param.insuranceCompanyName.trim() != ''"> <if test="param.insuranceCompanyName != null and param.insuranceCompanyName.trim() != ''">
and INSURANCE_COMPANY_NAME like concat('%',replace(replace(#{param.insuranceCompanyName},'_','\_'),'%','\%'),'%') and INSURANCE_COMPANY_NAME like concat('%',replace(replace(#{param.insuranceCompanyName},'_','\_'),'%','\%'),'%')
</if> </if>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment