that should do what you want but in future dont use == 1 just a waste of time
If Setting = 0 (! is the primary element in this query)
!$this->settings['']
If Setting = 1
$this->settings['']
Your Query
<if test="$this->settings['...']">
<if test="in_array( $this->memberData['member_group_id'] , explode(',' ,$this->settings['....']) )">