|
|
@ -41,72 +41,73 @@ |
|
|
|
FROM |
|
|
|
pli_rent_contract_info i |
|
|
|
LEFT JOIN pli_rent_blacklist b ON i.LESSEE_ID_CARD = b.ID_CARD |
|
|
|
<where> |
|
|
|
<if test="gridId != null and gridId != ''"> |
|
|
|
AND i.GRID_ID = #{gridId} |
|
|
|
</if> |
|
|
|
<if test="villageId != null and villageId != ''"> |
|
|
|
AND i.VILLAGE_ID = #{villageId} |
|
|
|
</if> |
|
|
|
<if test="buildId != null and buildId != ''"> |
|
|
|
AND i.BUILD_ID = #{buildId} |
|
|
|
</if> |
|
|
|
<if test="unitId != null and unitId != ''"> |
|
|
|
AND i.UNIT_ID = #{unitId} |
|
|
|
</if> |
|
|
|
<if test="homeId != null and homeId != ''"> |
|
|
|
AND i.HOME_ID = #{homeId} |
|
|
|
</if> |
|
|
|
<if test="state != null and state != ''"> |
|
|
|
AND i.STATE = #{state} |
|
|
|
</if> |
|
|
|
<if test="lessorName != null and lessorName != ''"> |
|
|
|
AND i.LESSOR_NAME = #{lessorName} |
|
|
|
</if> |
|
|
|
<if test="lessorIdCard != null and lessorIdCard != ''"> |
|
|
|
AND i.LESSOR_ID_CARD = #{lessorIdCard} |
|
|
|
</if> |
|
|
|
<if test="lessorMobile != null and lessorMobile != ''"> |
|
|
|
AND i.LESSOR_MOBILE = #{lessorMobile} |
|
|
|
</if> |
|
|
|
<if test="lesseeName != null and lesseeName != ''"> |
|
|
|
AND i.LESSEE_NAME = #{lesseeName} |
|
|
|
</if> |
|
|
|
<if test="lesseeIdCard != null and lesseeIdCard != ''"> |
|
|
|
AND i.LESSEE_ID_CARD = #{lesseeIdCard} |
|
|
|
</if> |
|
|
|
<if test="lesseeMobile != null and lesseeMobile != ''"> |
|
|
|
AND i.LESSEE_MOBILE = #{lesseeMobile} |
|
|
|
</if> |
|
|
|
<if test="reviewStartTime != null and reviewStartTime != ''"> |
|
|
|
AND i.REVIEW_DATE >= #{reviewStartTime} |
|
|
|
</if> |
|
|
|
<if test="reviewEndTime != null and reviewEndTime != ''"> |
|
|
|
AND i.REVIEW_DATE <= #{reviewEndTime} |
|
|
|
</if> |
|
|
|
<if test="startTime != null and startTime != ''"> |
|
|
|
AND i.SIGN_DATE >= #{startTime} |
|
|
|
</if> |
|
|
|
<if test="endTime != null and endTime != ''"> |
|
|
|
AND i.SIGN_DATE <= #{endTime} |
|
|
|
</if> |
|
|
|
<if test="endDate != null and endDate != ''"> |
|
|
|
<if test="endDate == '0' or endDate == 0"> |
|
|
|
AND DATE( i.END_DATE ) <= DATE_ADD( curdate(), INTERVAL 1 MONTH ) |
|
|
|
AND DATE( i.END_DATE ) > CURDATE() |
|
|
|
</if> |
|
|
|
<if test="endDate == '1' or endDate == 1"> |
|
|
|
AND DATE( i.END_DATE ) <= DATE_ADD( curdate(), INTERVAL 2 MONTH ) |
|
|
|
AND DATE( i.END_DATE ) > CURDATE() |
|
|
|
</if> |
|
|
|
<if test="endDate == '2' or endDate == 2"> |
|
|
|
AND DATE( i.END_DATE ) <= DATE_ADD( curdate(), INTERVAL 3 MONTH ) |
|
|
|
AND DATE( i.END_DATE ) > CURDATE() |
|
|
|
</if> |
|
|
|
<if test="endDate == '3' or endDate == 3"> |
|
|
|
AND DATE( i.END_DATE ) <= CURDATE() |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
WHERE |
|
|
|
i.DEL_FLAG = '0' |
|
|
|
AND b.DEL_FLAG = '0' |
|
|
|
<if test="gridId != null and gridId != ''"> |
|
|
|
AND i.GRID_ID = #{gridId} |
|
|
|
</if> |
|
|
|
<if test="villageId != null and villageId != ''"> |
|
|
|
AND i.VILLAGE_ID = #{villageId} |
|
|
|
</if> |
|
|
|
<if test="buildId != null and buildId != ''"> |
|
|
|
AND i.BUILD_ID = #{buildId} |
|
|
|
</if> |
|
|
|
<if test="unitId != null and unitId != ''"> |
|
|
|
AND i.UNIT_ID = #{unitId} |
|
|
|
</if> |
|
|
|
<if test="homeId != null and homeId != ''"> |
|
|
|
AND i.HOME_ID = #{homeId} |
|
|
|
</if> |
|
|
|
<if test="state != null and state != ''"> |
|
|
|
AND i.STATE = #{state} |
|
|
|
</if> |
|
|
|
<if test="lessorName != null and lessorName != ''"> |
|
|
|
AND i.LESSOR_NAME = #{lessorName} |
|
|
|
</if> |
|
|
|
<if test="lessorIdCard != null and lessorIdCard != ''"> |
|
|
|
AND i.LESSOR_ID_CARD = #{lessorIdCard} |
|
|
|
</if> |
|
|
|
<if test="lessorMobile != null and lessorMobile != ''"> |
|
|
|
AND i.LESSOR_MOBILE = #{lessorMobile} |
|
|
|
</if> |
|
|
|
<if test="lesseeName != null and lesseeName != ''"> |
|
|
|
AND i.LESSEE_NAME = #{lesseeName} |
|
|
|
</if> |
|
|
|
<if test="lesseeIdCard != null and lesseeIdCard != ''"> |
|
|
|
AND i.LESSEE_ID_CARD = #{lesseeIdCard} |
|
|
|
</if> |
|
|
|
<if test="lesseeMobile != null and lesseeMobile != ''"> |
|
|
|
AND i.LESSEE_MOBILE = #{lesseeMobile} |
|
|
|
</if> |
|
|
|
<if test="reviewStartTime != null and reviewStartTime != ''"> |
|
|
|
AND i.REVIEW_DATE >= #{reviewStartTime} |
|
|
|
</if> |
|
|
|
<if test="reviewEndTime != null and reviewEndTime != ''"> |
|
|
|
AND i.REVIEW_DATE <= #{reviewEndTime} |
|
|
|
</if> |
|
|
|
<if test="startTime != null and startTime != ''"> |
|
|
|
AND i.SIGN_DATE >= #{startTime} |
|
|
|
</if> |
|
|
|
<if test="endTime != null and endTime != ''"> |
|
|
|
AND i.SIGN_DATE <= #{endTime} |
|
|
|
</if> |
|
|
|
<if test="endDate != null and endDate != ''"> |
|
|
|
<if test="endDate == '0' or endDate == 0"> |
|
|
|
AND DATE( i.END_DATE ) <= DATE_ADD( curdate(), INTERVAL 1 MONTH ) |
|
|
|
AND DATE( i.END_DATE ) > CURDATE() |
|
|
|
</if> |
|
|
|
<if test="endDate == '1' or endDate == 1"> |
|
|
|
AND DATE( i.END_DATE ) <= DATE_ADD( curdate(), INTERVAL 2 MONTH ) |
|
|
|
AND DATE( i.END_DATE ) > CURDATE() |
|
|
|
</if> |
|
|
|
<if test="endDate == '2' or endDate == 2"> |
|
|
|
AND DATE( i.END_DATE ) <= DATE_ADD( curdate(), INTERVAL 3 MONTH ) |
|
|
|
AND DATE( i.END_DATE ) > CURDATE() |
|
|
|
</if> |
|
|
|
<if test="endDate == '3' or endDate == 3"> |
|
|
|
AND DATE( i.END_DATE ) <= CURDATE() |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
</select> |
|
|
|
</mapper> |