| | |
| | | select |
| | | jtrpa.*, |
| | | br.town_name streetName, |
| | | case |
| | | when TIMESTAMPDIFF(year, substring(jtrpa.id_card, 7, 8), now()) < 18 then 2 |
| | | when TIMESTAMPDIFF(year, substring(jtrpa.id_card, 7, 8), now()) >= 18 then 1 |
| | | end as minors, |
| | | jg.grid_name, |
| | | jda.aoi_name, |
| | | br.village_name communityName, |
| | |
| | | <if test="residen.minors!=null and residen.minors ==2"> |
| | | and TIMESTAMPDIFF(year, substring(jtrpa.id_card, 7, 8), now()) < 18 |
| | | </if> |
| | | <if test="residen.minors!=null and residen.minors ==1"> |
| | | and TIMESTAMPDIFF(year, substring(jtrpa.id_card, 7, 8), now()) >= 18 |
| | | </if> |
| | | <if test="residen.id != null ">and jtrpa.id = #{residen.id}</if> |
| | | <if test="residen.name != null and residen.name != ''">and jtrpa.name like CONCAT('%',#{residen.name},'%')</if> |
| | | <if test="residen.phone != null and residen.phone != ''">and jtrpa.phone like CONCAT('%',#{residen.phone},'%')</if> |