|
|
@ -125,6 +125,8 @@ |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="subCondition.queryType!= null and subCondition.queryType == 'daterange' "> |
|
|
|
and ${subCondition.tableName}.${subCondition.columnName} is not null |
|
|
|
and ${subCondition.tableName}.${subCondition.columnName} !='' |
|
|
|
and ${subCondition.tableName}.${subCondition.columnName} between #{subCondition.columnValue[0]} and #{subCondition.columnValue[1]} |
|
|
|
</if> |
|
|
|
|
|
|
@ -180,6 +182,8 @@ |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="subCondition.queryType!= null and subCondition.queryType == 'daterange' "> |
|
|
|
and ${subCondition.tableName}.${subCondition.columnName} is not null |
|
|
|
and ${subCondition.tableName}.${subCondition.columnName} !='' |
|
|
|
and ${subCondition.tableName}.${subCondition.columnName} between #{subCondition.columnValue[0]} and #{subCondition.columnValue[1]} |
|
|
|
</if> |
|
|
|
|
|
|
@ -1548,11 +1552,11 @@ |
|
|
|
u.ID, |
|
|
|
YEAR(NOW())-SUBSTR(u.BIRTHDAY, 1, 4) as age, |
|
|
|
( |
|
|
|
case when YEAR(NOW())-SUBSTR(u.BIRTHDAY, 1, 4) < 50 then '0' |
|
|
|
when YEAR(NOW())-SUBSTR(u.BIRTHDAY, 1, 4) >=50 and YEAR(NOW())-SUBSTR(u.BIRTHDAY, 1, 4) <=59 then '1' |
|
|
|
when YEAR(NOW())-SUBSTR(u.BIRTHDAY, 1, 4) >=60 and YEAR(NOW())-SUBSTR(u.BIRTHDAY, 1, 4) <=69 then '2' |
|
|
|
when YEAR(NOW())-SUBSTR(u.BIRTHDAY, 1, 4) >=70 and YEAR(NOW())-SUBSTR(u.BIRTHDAY, 1, 4) <=79 then '3' |
|
|
|
when YEAR(NOW())-SUBSTR(u.BIRTHDAY, 1, 4) >=80 then '4' |
|
|
|
case when u.BIRTHDAY > DATE_SUB(CURDATE(),INTERVAL 50 year) then '0' |
|
|
|
when u.BIRTHDAY BETWEEN DATE_SUB(CURDATE(),INTERVAL 59 year) AND DATE_SUB(CURDATE(),INTERVAL 50 year) then '1' |
|
|
|
when u.BIRTHDAY BETWEEN DATE_SUB(CURDATE(),INTERVAL 69 year) AND DATE_SUB(CURDATE(),INTERVAL 60 year) then '2' |
|
|
|
when u.BIRTHDAY BETWEEN DATE_SUB(CURDATE(),INTERVAL 79 year) AND DATE_SUB(CURDATE(),INTERVAL 70 year) then '3' |
|
|
|
when u.BIRTHDAY <= DATE_SUB(CURDATE(),INTERVAL 80 year) then '4' |
|
|
|
end |
|
|
|
) as `code` |
|
|
|
FROM |
|
|
@ -1606,30 +1610,20 @@ |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
<if test='codeType == "age" '> |
|
|
|
<if test=" '0' == code"> |
|
|
|
and u.BIRTHDAY is not null |
|
|
|
and u.BIRTHDAY !='' |
|
|
|
and YEAR(NOW())-SUBSTR(u.BIRTHDAY, 1, 4) < 50 |
|
|
|
<if test=" 0 == code"> |
|
|
|
and u.BIRTHDAY > DATE_SUB(CURDATE(),INTERVAL 50 year) |
|
|
|
</if> |
|
|
|
<if test=" '1' == code"> |
|
|
|
and u.BIRTHDAY is not null |
|
|
|
and u.BIRTHDAY !='' |
|
|
|
and YEAR(NOW())-SUBSTR(u.BIRTHDAY, 1, 4) >=50 and YEAR(NOW())-SUBSTR(u.BIRTHDAY, 1, 4) <=59 |
|
|
|
<if test=" 1 == code"> |
|
|
|
and u.BIRTHDAY BETWEEN DATE_SUB(CURDATE(),INTERVAL 59 year) AND DATE_SUB(CURDATE(),INTERVAL 50 year) |
|
|
|
</if> |
|
|
|
<if test=" '2' == code"> |
|
|
|
and u.BIRTHDAY is not null |
|
|
|
and u.BIRTHDAY !='' |
|
|
|
and YEAR(NOW())-SUBSTR(u.BIRTHDAY, 1, 4) >=60 and YEAR(NOW())-SUBSTR(u.BIRTHDAY, 1, 4) <=69 |
|
|
|
<if test=" 2 == code"> |
|
|
|
and u.BIRTHDAY BETWEEN DATE_SUB(CURDATE(),INTERVAL 69 year) AND DATE_SUB(CURDATE(),INTERVAL 60 year) |
|
|
|
</if> |
|
|
|
<if test=" '3' == code"> |
|
|
|
and u.BIRTHDAY is not null |
|
|
|
and u.BIRTHDAY !='' |
|
|
|
and YEAR(NOW())-SUBSTR(u.BIRTHDAY, 1, 4) >=70 and YEAR(NOW())-SUBSTR(u.BIRTHDAY, 1, 4) <=79 |
|
|
|
<if test=" 3 == code"> |
|
|
|
and u.BIRTHDAY BETWEEN DATE_SUB(CURDATE(),INTERVAL 79 year) AND DATE_SUB(CURDATE(),INTERVAL 70 year) |
|
|
|
</if> |
|
|
|
<if test=" '4' == code"> |
|
|
|
and u.BIRTHDAY is not null |
|
|
|
and u.BIRTHDAY !='' |
|
|
|
and YEAR(NOW())-SUBSTR(u.BIRTHDAY, 1, 4) >=80 |
|
|
|
<if test=" 4 == code"> |
|
|
|
and u.BIRTHDAY <= DATE_SUB(CURDATE(),INTERVAL 80 year) |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
order by u.ID asc |
|
|
|