<iftest="params.beginCredentialExpirationTime != null and params.beginCredentialExpirationTime != '' and params.endCredentialExpirationTime != null and params.endCredentialExpirationTime != ''"> and spwp.credential_expiration_time between #{params.beginCredentialExpirationTime} and #{params.endCredentialExpirationTime}</if>
<iftest="isDel != null and isDel != ''"> and spwp.is_del = #{isDel}</if>
<iftest="specialType != null and credentialType != ''"> and spwp.special_type = #{specialType}</if>
<!-- 查询条件-项目部门 -->
<iftest="projectDeptId != null "> and sp.deptId = #{projectDeptId}</if>
<!--子部门数据-->
<iftest='nowRole == "4"'> and sp.deptId = #{nowDept}</if>
<!--监理单位/总包公司/分包单位查询当前关联数据-->
<iftest='nowRole == "5" or nowRole == "6" or nowRole == "7"'> and sp.id in (select DISTINCT spui.projectId from sur_project_unit_info spui where spui.unitId = #{nowDept})</if>
<iftest='nowRole == "15" or nowRole == "16" or nowRole == "17" or nowRole == "99"'> and sp.id in (select DISTINCT spu.project_id from sur_project_userinfo spu where spu.user_id = #{nowUser} and spu.is_del=0)</if>
<iftest="projectId != null "> and spwp.project_id = #{projectId}</if>
<iftest="deptId != null "> and spwp.dept_id = #{deptId}</if>
<iftest="name != null and name != ''"> and spwp.name like concat('%', #{name}, '%')</if>
<iftest="projectName != null and projectName != ''"> and sp.projectName like concat('%', #{projectName}, '%')</if>
<iftest="isCredential != null and isCredential != ''"> and spwp.is_credential = #{isCredential}</if>
<iftest="phoneNumber != null and phoneNumber != ''"> and spwp.phone_number like concat('%', #{phoneNumber}, '%')</if>
<iftest="credentialNumber != null and credentialNumber != ''"> and spwp.credential_number like concat('%', #{credentialNumber}, '%')</if>
<iftest="params.beginCredentialExpirationTime != null and params.beginCredentialExpirationTime != '' and params.endCredentialExpirationTime != null and params.endCredentialExpirationTime != ''"> and spwp.credential_expiration_time between #{params.beginCredentialExpirationTime} and #{params.endCredentialExpirationTime}</if>
<iftest="isDel != null and isDel != ''"> and spwp.is_del = #{isDel}</if>
<iftest="credentialType != null and credentialType != ''"> and spwp.credential_type = #{credentialType}</if>
<iftest="specialType != null and credentialType != ''"> and spwp.special_type = #{specialType}</if>
<!-- 查询条件-项目部门 -->
<iftest="projectDeptId != null "> and sp.deptId = #{projectDeptId}</if>
<!--子部门数据-->
<iftest='nowRole == "4"'> and sp.deptId = #{nowDept}</if>
<!--监理单位/总包公司/分包单位查询当前关联数据-->
<iftest='nowRole == "5" or nowRole == "6" or nowRole == "7"'> and sp.id in (select DISTINCT spui.projectId from sur_project_unit_info spui where spui.unitId = #{nowDept})</if>
<iftest='nowRole == "15" or nowRole == "16" or nowRole == "17" or nowRole == "99"'> and sp.id in (select DISTINCT spu.project_id from sur_project_userinfo spu where spu.user_id = #{nowUser} and spu.is_del=0)</if>
<iftest="projectId != null "> and spwp.project_id = #{projectId}</if>
<iftest="deptId != null "> and spwp.dept_id = #{deptId}</if>
<iftest="name != null and name != ''"> and spwp.name like concat('%', #{name}, '%')</if>
<iftest="projectName != null and projectName != ''"> and sp.projectName like concat('%', #{projectName}, '%')</if>
<iftest="isCredential != null and isCredential != ''"> and spwp.is_credential = #{isCredential}</if>
<iftest="phoneNumber != null and phoneNumber != ''"> and spwp.phone_number like concat('%', #{phoneNumber}, '%')</if>
<iftest="credentialNumber != null and credentialNumber != ''"> and spwp.credential_number like concat('%', #{credentialNumber}, '%')</if>
<iftest="params.beginCredentialExpirationTime != null and params.beginCredentialExpirationTime != '' and params.endCredentialExpirationTime != null and params.endCredentialExpirationTime != ''"> and spwp.credential_expiration_time between #{params.beginCredentialExpirationTime} and #{params.endCredentialExpirationTime}</if>
<iftest="isDel != null and isDel != ''"> and spwp.is_del = #{isDel}</if>
<iftest="credentialType != null and credentialType != ''"> and spwp.credential_type = #{credentialType}</if>
<iftest="specialType != null and credentialType != ''"> and spwp.special_type = #{specialType}</if>
<iftest='nowRole == "5" or nowRole == "6" or nowRole == "7"'> and sp.id in (select DISTINCT spui.projectId from sur_project_unit_info spui where spui.unitId = #{nowDept})</if>
<iftest='nowRole == "15" or nowRole == "16" or nowRole == "17" or nowRole == "99"'> and sp.id in (select DISTINCT spu.project_id from sur_project_userinfo spu where spu.user_id = #{nowUser} and spu.is_del=0)</if>