| | |
| | | </otherwise> |
| | | </choose> |
| | | </select> |
| | | <select id="pageListByBusinessDeptId" resultType="com.ruoyi.system.vo.TenantVO"> |
| | | SELECT * FROM ( |
| | | SELECT tt.id, tt.resident_name, tt.checkIn_time, tt.tenant_attributes, tt.tenant_type, tt.phone, |
| | | tt.id_card, tt.email, |
| | | tt.bank_number, tt.mail_address, tt.create_time, tt.disabled,tt.account |
| | | FROM t_tenant tt |
| | | WHERE EXISTS ( |
| | | SELECT 1 |
| | | FROM t_contract tc |
| | | WHERE tc.tenant_id = tt.id AND tc.business_dept_id = #{query.businessDeptId} |
| | | ) |
| | | ) AS te |
| | | <where> |
| | | <if test="query.residentName != null and query.residentName != ''"> |
| | | AND te.resident_name LIKE concat('%',#{query.residentName},'%') |
| | | </if> |
| | | <if test="query.phone != null and query.phone != ''"> |
| | | AND te.phone LIKE concat('%',#{query.phone},'%') |
| | | </if> |
| | | AND te.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | ORDER BY te.create_time DESC |
| | | </select> |
| | | |
| | | </mapper> |