select `parent_id` as `parentId`,`user_id`as `userId`,`bind_time` as `bindTime` from `app_user_relation` where `parent_id`=#{leaderId} and `is_del`=0 order by `bind_time` DESC
select `parent_id` as `parentId`,`user_id`as `userId`,`bind_time` as `bindTime` from `app_user_relation` where `parent_id`=#{leaderId} and `is_del`=0 order by `bind_time` DESC
</select>
</select>
<selectid="countByParentId"resultType="Integer">
select count(*) from `app_user_relation` where
`parent_id`=#{parentId} and `is_del`=0
<iftest="bindTime!='' and bindTime!=null and bindTime>0">