<select id="findBy" resultMap="RfCustomerMemMap" parameterType="java.util.Map">
SELECT
<include refid="Column"/>
FROM rfl_customer_mem a LEFT JOIN rfl_loan b ON a.member_no = b.loan_member_no
WHERE a.member_no = #{memberNo} AND b.status IN
<foreach collection="status" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
<if test="name != null and name != ''">
AND name = #{name}
</if>
<if test="idNumber != null and idNumber != ''">
AND id_number = #{idNumber}
</if>
<if test="mobileNo != null and mobileNo != ''">
AND mobile_no = #{mobileNo}
</if>
<if test="loanNo != null and loanNo != ''">
AND loan_no = #{loanNo}
</if>
order by a.id DESC
<if test="offset > -1 and rows > -1">
limit #{offset},#{limit}
</if>
</select>