DISTINCT *
and id = #{p.id}
and user_id = #{p.userId}
and hospital_id = #{p.hospitalId}
and hospital_name like '%${p.hospitalName}%'
and department_id = #{p.departmentId}
and department_name = #{p.departmentName}
and doctor_name like '%${p.doctorName}%'
and doctor_logo = #{p.doctorLogo}
and doctor_tel like concat('%',#{p.doctorTel},'%')
and doctor_rank_id = #{p.doctorRankId}
and doctor_rank = #{p.doctorRank}
and doctor_other_link = #{p.doctorOtherLink}
and doctor_email = #{p.doctorEmail}
and doctor_about = #{p.doctorAbout}
and is_answer = #{p.isAnswer}
and is_signing = #{p.isSigning}
and is_top = #{p.isTop}
and is_del = #{p.isDel}
and doctor_state = #{p.doctorState}
and enabled = #{p.enabled}
and create_user_id = #{p.createUserId}
and create_user_name = #{p.createUserName}
and update_user_id = #{p.updateUserId}
and update_user_name = #{p.updateUserName}
and create_time = #{p.createTime}
and update_time = #{p.updateTime}
is_del=0
or ( is_del = 0 and enabled=1)
AND
create_user_org_code = #{itemtoto.orgCode}
or (
create_user_org_code = #{itemtoto.orgCode}
and is_del = 0 and enabled=1
)
AND
create_user_org_code = #{itemto.object}
or (create_user_org_code = #{itemto.object} and is_del = 0 and enabled=1)
AND
create_user_org_code like '${itemto.object}%'
or (create_user_org_code like '${itemto.object}%' and is_del = 0 and enabled=1)
AND
create_user_id = #{itemto.object}
or (create_user_id = #{itemto.object} and is_del = 0 and enabled=1)
AND id is null
is_del=0