1 package org.turro.crm.search;
3 import org.turro.auth.Authentication;
4 import org.turro.crm.db.CrmPU;
5 import org.turro.elephant.context.Application;
6 import org.turro.elephant.db.SQLHelper;
7 import org.turro.elephant.db.WhereClause;
8 import org.turro.jpa.Dao;
9 import org.turro.plugin.contacts.IContact;
10 import org.zkoss.lang.Strings;
20 private boolean ckOthers;
21 private String customerValue =
"*";
36 wc.
addClause(
"from Customer as customer");
37 wc.
addClause(
"left outer join customer.ownedBy ownedBy");
40 if(Strings.isEmpty(customerValue) || (ckOthers && !app.
isInRole(
"customer:all"))) {
45 if(byParticipant ==
null) {
51 }, (customerValue ==
null ?
"" : customerValue.replaceAll(
"\\*",
"%")));
53 if(!(ckOthers && app.
isInRole(
"customer:all"))) {
56 wc.
addClause(
"ownedBy.vendor.idContact = :idOwner");
62 "select vp from VendorProspect as vp where vendor.idContact = :idVendor " +
63 "and vp.saleProspect.customer = customer"
80 this.byParticipant = byParticipant;
88 this.ckOthers = ckOthers;
96 this.customerValue = customerValue;
static IContact getIContact()
java.util.List getCustomerList()
WhereClause createCriteria()
void setCkOthers(boolean ckOthers)
IContact getByParticipant()
String getCustomerValue()
void setCustomerValue(String customerValue)
void setByParticipant(IContact byParticipant)
boolean isInRole(String role)
static Application getApplication()
static WhereClause getWhereClause(String[] fields, String value)
void addClause(String clause)
void addNamedValue(String name, Object value)