| | |
| | | } |
| | | return tb_departmentList; |
| | | } |
| | | |
| | | public List<tb_department> getDepartmentManagement2() { |
| | | String sql = null; |
| | | Query query = null; |
| | | sql = "SELECT id,departmentName,iconadress,addtime FROM tb_department"; |
| | | query = this.em.createNativeQuery(sql); |
| | | List resultList = query.getResultList(); |
| | | List<tb_department> tb_departmentList = new ArrayList<tb_department>(); |
| | | if (resultList.size() > 0) { |
| | | for (int i = 0; i < resultList.size(); i++) { |
| | | tb_department department = new tb_department(); |
| | | Object[] obj = (Object[]) resultList.get(i); |
| | | department.setId((int) obj[0]); |
| | | department.setDepartmentName(obj[1] == null ? "" : obj[1].toString()); |
| | | department.setIconadress(obj[2] == null ? "" : obj[2].toString()); |
| | | department.setAddtime(obj[3] == null ? "" : obj[3].toString()); |
| | | tb_departmentList.add(department); |
| | | } |
| | | } |
| | | return tb_departmentList; |
| | | } |
| | | |
| | | public List<tb_icon> getIconList() { |
| | | String sql = null; |
| | |
| | | return tb_personList; |
| | | } |
| | | |
| | | public List<tb_person> getPersonManagement2() { |
| | | String sql = null; |
| | | Query query = null; |
| | | sql = "SELECT p.id,p.p_name,p.p_tagid,p.p_power,p.p_image,p.p_addtiem,p.p_department FROM tb_person p,tb_tag t WHERE p.p_tagid = t.tag_id AND t.type = '车载带屏' OR p.p_tagid = t.tag_id AND t.type = '车载无屏'"; |
| | | query = this.em.createNativeQuery(sql); |
| | | List resultList = query.getResultList(); |
| | | List<tb_person> tb_personList = new ArrayList<tb_person>(); |
| | | if (resultList.size() > 0) { |
| | | for (int i = 0; i < resultList.size(); i++) { |
| | | tb_person person = new tb_person(); |
| | | Object[] obj = (Object[]) resultList.get(i); |
| | | person.setId((int) obj[0]); |
| | | person.setP_name(obj[1] == null ? "" : obj[1].toString()); |
| | | person.setP_tagid(obj[2] == null ? "" : obj[2].toString()); |
| | | person.setP_department(obj[6] == null ? "" : obj[6].toString()); |
| | | person.setP_power(obj[3] == null ? "" : obj[3].toString()); |
| | | person.setP_image(obj[4] == null ? "" : obj[4].toString()); |
| | | person.setP_addtiem(obj[5] == null ? "" : obj[5].toString()); |
| | | tb_personList.add(person); |
| | | } |
| | | } |
| | | return tb_personList; |
| | | } |
| | | |
| | | public List<tb_person> getPersonManagement3() { |
| | | String sql = null; |
| | | Query query = null; |
| | | sql = "SELECT p.id,p.p_name,p.p_tagid,p.p_power,p.p_image,p.p_addtiem,p.p_department FROM tb_person p,tb_tag t WHERE p.p_tagid = t.tag_id AND t.type = '物资标签'"; |
| | | query = this.em.createNativeQuery(sql); |
| | | List resultList = query.getResultList(); |
| | | List<tb_person> tb_personList = new ArrayList<tb_person>(); |
| | | if (resultList.size() > 0) { |
| | | for (int i = 0; i < resultList.size(); i++) { |
| | | tb_person person = new tb_person(); |
| | | Object[] obj = (Object[]) resultList.get(i); |
| | | person.setId((int) obj[0]); |
| | | person.setP_name(obj[1] == null ? "" : obj[1].toString()); |
| | | person.setP_tagid(obj[2] == null ? "" : obj[2].toString()); |
| | | person.setP_department(obj[6] == null ? "" : obj[6].toString()); |
| | | person.setP_power(obj[3] == null ? "" : obj[3].toString()); |
| | | person.setP_image(obj[4] == null ? "" : obj[4].toString()); |
| | | person.setP_addtiem(obj[5] == null ? "" : obj[5].toString()); |
| | | tb_personList.add(person); |
| | | } |
| | | } |
| | | return tb_personList; |
| | | } |
| | | |
| | | public List<tb_person> getPersonManagement4() { |
| | | String sql = null; |
| | | Query query = null; |
| | | sql = "SELECT p.id,p.p_name,p.p_tagid,p.p_power,p.p_image,p.p_addtiem,p.p_department,p.p_sex,p.p_phone FROM tb_person p,tb_tag t WHERE p.p_tagid = t.tag_id AND t.type <> '车载带屏' AND t.type <> '车载无屏' AND t.type <> '物资标签'"; |
| | | query = this.em.createNativeQuery(sql); |
| | | List resultList = query.getResultList(); |
| | | List<tb_person> tb_personList = new ArrayList<tb_person>(); |
| | | if (resultList.size() > 0) { |
| | | for (int i = 0; i < resultList.size(); i++) { |
| | | tb_person person = new tb_person(); |
| | | Object[] obj = (Object[]) resultList.get(i); |
| | | person.setId((int) obj[0]); |
| | | person.setP_name(obj[1] == null ? "" : obj[1].toString()); |
| | | person.setP_tagid(obj[2] == null ? "" : obj[2].toString()); |
| | | person.setP_power(obj[3] == null ? "" : obj[3].toString()); |
| | | person.setP_image(obj[4] == null ? "" : obj[4].toString()); |
| | | person.setP_addtiem(obj[5] == null ? "" : obj[5].toString()); |
| | | person.setP_department(obj[6] == null ? "" : obj[6].toString()); |
| | | person.setP_sex(obj[7] == null ? "" : obj[7].toString()); |
| | | person.setP_phone(obj[8] == null ? "" : obj[8].toString()); |
| | | tb_personList.add(person); |
| | | } |
| | | } |
| | | return tb_personList; |
| | | } |
| | | |
| | | public List<tb_person> getPersonManagementTemplate(int page) { |
| | | int perPage = Integer.parseInt(ModifyConfig.readData(Config.getPageConfig(), "perPage")); |
| | | int start = (page - 1) * perPage; |
| | |
| | | } |
| | | return tb_personList; |
| | | } |
| | | |
| | | public List<tb_person> getPersonManagementTemplate2(int page) { |
| | | int perPage = Integer.parseInt(ModifyConfig.readData(Config.getPageConfig(), "perPage")); |
| | | int start = (page - 1) * perPage; |
| | | int end = perPage; |
| | | String sql = null; |
| | | Query query = null; |
| | | sql = "SELECT p.p_name,p.p_tagid,p.p_department FROM tb_person p,tb_tag t WHERE p.p_tagid = t.tag_id AND t.type = '车载带屏' OR p.p_tagid = t.tag_id AND t.type = '车载无屏' LIMIT :start,:end"; |
| | | query = this.em.createNativeQuery(sql); |
| | | query.setParameter("start", start); |
| | | query.setParameter("end", end); |
| | | List resultList = query.getResultList(); |
| | | List<tb_person> tb_personList = new ArrayList<tb_person>(); |
| | | if (resultList.size() > 0) { |
| | | for (int i = 0; i < resultList.size(); i++) { |
| | | tb_person person = new tb_person(); |
| | | Object[] obj = (Object[]) resultList.get(i); |
| | | person.setP_name(obj[0] == null ? "" : obj[0].toString()); |
| | | person.setP_tagid(obj[1] == null ? "" : obj[1].toString()); |
| | | person.setP_department(obj[2] == null ? "" : obj[2].toString()); |
| | | tb_personList.add(person); |
| | | } |
| | | } |
| | | return tb_personList; |
| | | } |
| | | |
| | | public List<tb_person> getPersonManagementTemplate3(int page) { |
| | | int perPage = Integer.parseInt(ModifyConfig.readData(Config.getPageConfig(), "perPage")); |
| | | int start = (page - 1) * perPage; |
| | | int end = perPage; |
| | | String sql = null; |
| | | Query query = null; |
| | | sql = "SELECT p.p_name,p.p_tagid,p.p_department FROM tb_person p,tb_tag t WHERE p.p_tagid = t.tag_id AND t.type = '物资标签' LIMIT :start,:end"; |
| | | query = this.em.createNativeQuery(sql); |
| | | query.setParameter("start", start); |
| | | query.setParameter("end", end); |
| | | List resultList = query.getResultList(); |
| | | List<tb_person> tb_personList = new ArrayList<tb_person>(); |
| | | if (resultList.size() > 0) { |
| | | for (int i = 0; i < resultList.size(); i++) { |
| | | tb_person person = new tb_person(); |
| | | Object[] obj = (Object[]) resultList.get(i); |
| | | person.setP_name(obj[0] == null ? "" : obj[0].toString()); |
| | | person.setP_tagid(obj[1] == null ? "" : obj[1].toString()); |
| | | person.setP_department(obj[2] == null ? "" : obj[2].toString()); |
| | | tb_personList.add(person); |
| | | } |
| | | } |
| | | return tb_personList; |
| | | } |
| | | |
| | | public List<tb_person> getPersonManagementTemplate4(int page) { |
| | | int perPage = Integer.parseInt(ModifyConfig.readData(Config.getPageConfig(), "perPage")); |
| | | int start = (page - 1) * perPage; |
| | | int end = perPage; |
| | | String sql = null; |
| | | Query query = null; |
| | | sql = "SELECT p.p_name,p.p_tagid,p.p_sex,p.p_phone,p.p_department FROM tb_person p,tb_tag t WHERE p.p_tagid = t.tag_id AND t.type <> '车载带屏' AND t.type <> '车载无屏' AND t.type <> '物资标签' LIMIT :start,:end"; |
| | | query = this.em.createNativeQuery(sql); |
| | | query.setParameter("start", start); |
| | | query.setParameter("end", end); |
| | | List resultList = query.getResultList(); |
| | | List<tb_person> tb_personList = new ArrayList<tb_person>(); |
| | | if (resultList.size() > 0) { |
| | | for (int i = 0; i < resultList.size(); i++) { |
| | | tb_person person = new tb_person(); |
| | | Object[] obj = (Object[]) resultList.get(i); |
| | | person.setP_name(obj[0] == null ? "" : obj[0].toString()); |
| | | person.setP_tagid(obj[1] == null ? "" : obj[1].toString()); |
| | | person.setP_sex(obj[2] == null ? "" : obj[2].toString()); |
| | | person.setP_department(obj[4] == null ? "" : obj[4].toString()); |
| | | person.setP_phone(obj[3] == null ? "" : obj[3].toString()); |
| | | tb_personList.add(person); |
| | | } |
| | | } |
| | | return tb_personList; |
| | | } |
| | | |
| | | public List<tb_person> getPersonManagement(int page) { |
| | | int perPage = Integer.parseInt(ModifyConfig.readData(Config.getPageConfig(), "perPage")); |
| | |
| | | } |
| | | return tb_personList; |
| | | } |
| | | |
| | | public List<tb_person> getPersonManagement2(int page) { |
| | | int perPage = Integer.parseInt(ModifyConfig.readData(Config.getPageConfig(), "perPage")); |
| | | int start = (page - 1) * perPage; |
| | | int end = 50; |
| | | String sql = null; |
| | | Query query = null; |
| | | sql = "SELECT p.id,p.p_name,p.p_tagid,p.p_power,p.p_image,p.p_addtiem,p.p_department FROM tb_person p,tb_tag t WHERE p.p_tagid = t.tag_id AND t.type = '车载带屏' OR p.p_tagid = t.tag_id AND t.type = '车载无屏' LIMIT :start,:end"; |
| | | query = this.em.createNativeQuery(sql); |
| | | query.setParameter("start", start); |
| | | query.setParameter("end", end); |
| | | List resultList = query.getResultList(); |
| | | List<tb_person> tb_personList = new ArrayList<tb_person>(); |
| | | if (resultList.size() > 0) { |
| | | for (int i = 0; i < resultList.size(); i++) { |
| | | tb_person person = new tb_person(); |
| | | Object[] obj = (Object[]) resultList.get(i); |
| | | person.setId((int) obj[0]); |
| | | person.setP_name(obj[1] == null ? "" : obj[1].toString()); |
| | | person.setP_tagid(obj[2] == null ? "" : obj[2].toString()); |
| | | person.setP_power(obj[3] == null ? "" : obj[3].toString()); |
| | | person.setP_image(obj[4] == null ? "" : obj[4].toString()); |
| | | person.setP_addtiem(obj[5] == null ? "" : obj[5].toString()); |
| | | person.setP_department(obj[6] == null ? "" : obj[6].toString()); |
| | | tb_personList.add(person); |
| | | } |
| | | } |
| | | return tb_personList; |
| | | } |
| | | |
| | | public List<tb_person> getPersonManagement3(int page) { |
| | | int perPage = Integer.parseInt(ModifyConfig.readData(Config.getPageConfig(), "perPage")); |
| | | int start = (page - 1) * perPage; |
| | | int end = 50; |
| | | String sql = null; |
| | | Query query = null; |
| | | sql = "SELECT p.id,p.p_name,p.p_tagid,p.p_power,p.p_image,p.p_addtiem,p.p_department FROM tb_person p,tb_tag t WHERE p.p_tagid = t.tag_id AND t.type = '物资标签' LIMIT :start,:end"; |
| | | query = this.em.createNativeQuery(sql); |
| | | query.setParameter("start", start); |
| | | query.setParameter("end", end); |
| | | List resultList = query.getResultList(); |
| | | List<tb_person> tb_personList = new ArrayList<tb_person>(); |
| | | if (resultList.size() > 0) { |
| | | for (int i = 0; i < resultList.size(); i++) { |
| | | tb_person person = new tb_person(); |
| | | Object[] obj = (Object[]) resultList.get(i); |
| | | person.setId((int) obj[0]); |
| | | person.setP_name(obj[1] == null ? "" : obj[1].toString()); |
| | | person.setP_tagid(obj[2] == null ? "" : obj[2].toString()); |
| | | person.setP_power(obj[3] == null ? "" : obj[3].toString()); |
| | | person.setP_image(obj[4] == null ? "" : obj[4].toString()); |
| | | person.setP_addtiem(obj[5] == null ? "" : obj[5].toString()); |
| | | person.setP_department(obj[6] == null ? "" : obj[6].toString()); |
| | | tb_personList.add(person); |
| | | } |
| | | } |
| | | return tb_personList; |
| | | } |
| | | |
| | | public List<tb_person> getPersonManagement4(int page) { |
| | | int perPage = Integer.parseInt(ModifyConfig.readData(Config.getPageConfig(), "perPage")); |
| | | int start = (page - 1) * perPage; |
| | | int end = 50; |
| | | String sql = null; |
| | | Query query = null; |
| | | sql = "SELECT p.id,p.p_name,p.p_tagid,p.p_power,p.p_image,p.p_addtiem,p.p_department,p.p_sex,p.p_phone FROM tb_person p,tb_tag t WHERE p.p_tagid = t.tag_id AND t.type <> '车载带屏' AND t.type <> '车载无屏' AND t.type <> '物资标签' LIMIT :start,:end"; |
| | | query = this.em.createNativeQuery(sql); |
| | | query.setParameter("start", start); |
| | | query.setParameter("end", end); |
| | | List resultList = query.getResultList(); |
| | | List<tb_person> tb_personList = new ArrayList<tb_person>(); |
| | | if (resultList.size() > 0) { |
| | | for (int i = 0; i < resultList.size(); i++) { |
| | | tb_person person = new tb_person(); |
| | | Object[] obj = (Object[]) resultList.get(i); |
| | | person.setId((int) obj[0]); |
| | | person.setP_name(obj[1] == null ? "" : obj[1].toString()); |
| | | person.setP_tagid(obj[2] == null ? "" : obj[2].toString()); |
| | | person.setP_power(obj[3] == null ? "" : obj[3].toString()); |
| | | person.setP_image(obj[4] == null ? "" : obj[4].toString()); |
| | | person.setP_addtiem(obj[5] == null ? "" : obj[5].toString()); |
| | | person.setP_department(obj[6] == null ? "" : obj[6].toString()); |
| | | person.setP_sex(obj[7] == null ? "" : obj[7].toString()); |
| | | person.setP_phone(obj[8] == null ? "" : obj[8].toString()); |
| | | tb_personList.add(person); |
| | | } |
| | | } |
| | | return tb_personList; |
| | | } |
| | | |
| | | public int getPersonManagementCount() { |
| | | String sql = null; |
| | |
| | | query = this.em.createNativeQuery(sql); |
| | | return Integer.parseInt(query.getSingleResult().toString()); |
| | | } |
| | | |
| | | public int getPersonManagementCount2() { |
| | | String sql = null; |
| | | Query query = null; |
| | | sql = "SELECT count(*) FROM tb_person p,tb_tag t WHERE p.p_tagid = t.tag_id AND t.type = '车载带屏' OR p.p_tagid = t.tag_id AND t.type = '车载无屏'"; |
| | | query = this.em.createNativeQuery(sql); |
| | | return Integer.parseInt(query.getSingleResult().toString()); |
| | | } |
| | | |
| | | public int getPersonManagementCount3() { |
| | | String sql = null; |
| | | Query query = null; |
| | | sql = "SELECT count(*) FROM tb_person p,tb_tag t WHERE p.p_tagid = t.tag_id AND t.type = '物资标签'"; |
| | | query = this.em.createNativeQuery(sql); |
| | | return Integer.parseInt(query.getSingleResult().toString()); |
| | | } |
| | | |
| | | public int getPersonManagementCount4() { |
| | | String sql = null; |
| | | Query query = null; |
| | | sql = "SELECT count(*) FROM tb_person p,tb_tag t WHERE p.p_tagid = t.tag_id AND t.type <> '车载带屏' AND t.type <> '车载无屏' AND t.type <> '物资标签'"; |
| | | query = this.em.createNativeQuery(sql); |
| | | return Integer.parseInt(query.getSingleResult().toString()); |
| | | } |
| | | |
| | | public List<tb_person> searchPersonManagement2(String input) { |
| | | String sql = null; |
| | | Query query = null; |
| | | sql = "SELECT p.id,p.p_name,p.p_tagid,p.p_power,p.p_image,p.p_addtiem,p.p_department FROM tb_person p,tb_tag t WHERE p.p_tagid = t.tag_id AND t.type = '车载带屏' AND p.p_tagid = :p_tagid OR p.p_tagid = t.tag_id AND t.type = '车载带屏' AND p.p_name = :p_tagid OR p.p_tagid = t.tag_id AND t.type = '车载无屏' AND p.p_tagid = :p_tagid OR p.p_tagid = t.tag_id AND t.type = '车载无屏' AND p.p_name = :p_tagid"; |
| | | query = this.em.createNativeQuery(sql); |
| | | query.setParameter("p_tagid", input); |
| | | List resultList = query.getResultList(); |
| | | List<tb_person> tb_personList = new ArrayList<tb_person>(); |
| | | if (resultList.size() > 0) { |
| | | for (int i = 0; i < resultList.size(); i++) { |
| | | tb_person person = new tb_person(); |
| | | Object[] obj = (Object[]) resultList.get(i); |
| | | person.setId((int) obj[0]); |
| | | person.setP_name(obj[1] == null ? "" : obj[1].toString()); |
| | | person.setP_tagid(obj[2] == null ? "" : obj[2].toString()); |
| | | person.setP_department(obj[6] == null ? "" : obj[6].toString()); |
| | | person.setP_power(obj[3] == null ? "" : obj[3].toString()); |
| | | person.setP_image(obj[4] == null ? "" : obj[4].toString()); |
| | | person.setP_addtiem(obj[5] == null ? "" : obj[5].toString()); |
| | | tb_personList.add(person); |
| | | } |
| | | } |
| | | return tb_personList; |
| | | } |
| | | |
| | | public List<tb_person> searchPersonManagement3(String input) { |
| | | String sql = null; |
| | | Query query = null; |
| | | sql = "SELECT p.id,p.p_name,p.p_tagid,p.p_power,p.p_image,p.p_addtiem,p.p_department FROM tb_person p,tb_tag t WHERE p.p_tagid = t.tag_id AND t.type = '物资标签' AND p.p_tagid = :p_tagid OR p.p_tagid = t.tag_id AND t.type = '物资标签' AND p.p_name = :p_tagid"; |
| | | query = this.em.createNativeQuery(sql); |
| | | query.setParameter("p_tagid", input); |
| | | List resultList = query.getResultList(); |
| | | List<tb_person> tb_personList = new ArrayList<tb_person>(); |
| | | if (resultList.size() > 0) { |
| | | for (int i = 0; i < resultList.size(); i++) { |
| | | tb_person person = new tb_person(); |
| | | Object[] obj = (Object[]) resultList.get(i); |
| | | person.setId((int) obj[0]); |
| | | person.setP_name(obj[1] == null ? "" : obj[1].toString()); |
| | | person.setP_tagid(obj[2] == null ? "" : obj[2].toString()); |
| | | person.setP_department(obj[6] == null ? "" : obj[6].toString()); |
| | | person.setP_power(obj[3] == null ? "" : obj[3].toString()); |
| | | person.setP_image(obj[4] == null ? "" : obj[4].toString()); |
| | | person.setP_addtiem(obj[5] == null ? "" : obj[5].toString()); |
| | | tb_personList.add(person); |
| | | } |
| | | } |
| | | return tb_personList; |
| | | } |
| | | |
| | | public List<tb_person> searchPersonManagement4(String input) { |
| | | String sql = null; |
| | | Query query = null; |
| | | sql = "SELECT p.id,p.p_name,p.p_tagid,p.p_power,p.p_image,p.p_addtiem,p.p_department,p.p_sex,p.p_phone FROM tb_person p,tb_tag t WHERE p.p_tagid = t.tag_id AND t.type <> '车载带屏' AND t.type <> '车载无屏' AND t.type <> '物资标签' AND p.p_tagid = :p_tagid OR p.p_tagid = t.tag_id AND t.type <> '车载带屏' AND t.type <> '车载无屏' AND t.type <> '物资标签' AND p.p_name = :p_tagid"; |
| | | query = this.em.createNativeQuery(sql); |
| | | query.setParameter("p_tagid", input); |
| | | List resultList = query.getResultList(); |
| | | List<tb_person> tb_personList = new ArrayList<tb_person>(); |
| | | if (resultList.size() > 0) { |
| | | for (int i = 0; i < resultList.size(); i++) { |
| | | tb_person person = new tb_person(); |
| | | Object[] obj = (Object[]) resultList.get(i); |
| | | person.setId((int) obj[0]); |
| | | person.setP_name(obj[1] == null ? "" : obj[1].toString()); |
| | | person.setP_tagid(obj[2] == null ? "" : obj[2].toString()); |
| | | person.setP_power(obj[3] == null ? "" : obj[3].toString()); |
| | | person.setP_image(obj[4] == null ? "" : obj[4].toString()); |
| | | person.setP_addtiem(obj[5] == null ? "" : obj[5].toString()); |
| | | person.setP_department(obj[6] == null ? "" : obj[6].toString()); |
| | | person.setP_sex(obj[7] == null ? "" : obj[7].toString()); |
| | | person.setP_phone(obj[8] == null ? "" : obj[8].toString()); |
| | | tb_personList.add(person); |
| | | } |
| | | } |
| | | return tb_personList; |
| | | } |
| | | |
| | | public List<tb_person> searchPersonManagement(String input) { |
| | | String sql = null; |
| | | Query query = null; |
| | | sql = "SELECT id,p_name,p_tagid,p_sex,p_minzu,p_phone,p_department,p_ban,p_zu,p_idcardnum,p_adress,p_canin,p_x,p_y,p_floor,p_sos,p_online,p_power,p_kaoqing,p_fence,p_fencename,p_kaoqqingname,p_image,p_addtiem FROM tb_person WHERE p_tagid = :p_tagid"; |
| | | sql = "SELECT id,p_name,p_tagid,p_sex,p_minzu,p_phone,p_department,p_ban,p_zu,p_idcardnum,p_adress,p_canin,p_x,p_y,p_floor,p_sos,p_online,p_power,p_kaoqing,p_fence,p_fencename,p_kaoqqingname,p_image,p_addtiem FROM tb_person WHERE p_tagid = :p_tagid OR p_name = :p_tagid"; |
| | | query = this.em.createNativeQuery(sql); |
| | | query.setParameter("p_tagid", input); |
| | | List resultList = query.getResultList(); |
| | |
| | | return executeUpdate; |
| | | } |
| | | |
| | | // @Transactional |
| | | // public int personManagement_deleteAll() { |
| | | // String sql = null; |
| | | // Query query = null; |
| | | // String str = "未绑定"; |
| | | // sql = "UPDATE tb_person SET p_name=:str"; |
| | | // cs.tb_caozuo("tb_person", 3); |
| | | // query = this.em.createNativeQuery(sql); |
| | | // query.setParameter("str", str); |
| | | // query.executeUpdate(); |
| | | // int executeUpdate = query.executeUpdate(); |
| | | // return executeUpdate; |
| | | // } |
| | | |
| | | @Transactional |
| | | public int personManagement_deleteAll() { |
| | | String sql = null; |
| | | Query query = null; |
| | | String str = "未绑定"; |
| | | sql = "UPDATE tb_person SET p_name=:str"; |
| | | cs.tb_caozuo("tb_person", 3); |
| | | sql = "DELETE FROM tb_person"; |
| | | query = this.em.createNativeQuery(sql); |
| | | query.setParameter("str", str); |
| | | query.executeUpdate(); |
| | | int executeUpdate = query.executeUpdate(); |
| | | return executeUpdate; |
| | | } |
| | |
| | | int executeUpdate = query.executeUpdate(); |
| | | return executeUpdate; |
| | | } |
| | | |
| | | @Transactional |
| | | public int personManagement_modify2(tb_person person) { |
| | | String sql = null; |
| | | Query query = null; |
| | | sql = "UPDATE tb_person SET p_image = (SELECT iconadress FROM tb_department WHERE departmentName = :p_department LIMIT 1),p_power=(SELECT power FROM tb_tag WHERE tag_id = :p_tagid LIMIT 1),p_department = :p_department,p_name = :p_name,p_addtiem = now() WHERE p_tagid= :p_tagid"; |
| | | cs.tb_caozuo("tb_person", 3); |
| | | query = this.em.createNativeQuery(sql); |
| | | query.setParameter("p_tagid", person.getP_tagid()); |
| | | query.setParameter("p_department", person.getP_department()); |
| | | query.setParameter("p_name", person.getP_name()); |
| | | int executeUpdate = query.executeUpdate(); |
| | | return executeUpdate; |
| | | } |
| | | |
| | | @Transactional |
| | | public int personManagement_add(tb_person person) { |
| | | String sql = null; |
| | | Query query = null; |
| | | sql = "INSERT INTO tb_person(p_tagid,p_image,p_power,p_department,p_name,p_sex,p_phone,p_addtiem,p_minzu,p_x,p_y,p_floor,p_sos,p_online,p_kaoqing,p_fence) VALUES(:p_tagid,(SELECT iconadress FROM tb_department WHERE departmentName = :p_department LIMIT 1),(SELECT power FROM tb_tag WHERE tag_id = :p_tagid LIMIT 1),:p_department,:p_name,:p_sex,:p_phone,now(),:p_minzu,:p_x,:p_y,:p_floor,:p_sos,:p_online,:p_kaoqing,:p_fence)"; |
| | | sql = "INSERT INTO tb_person(p_tagid,p_image,p_power,p_department,p_name,p_sex,p_phone,p_addtiem,p_minzu,p_x,p_y,p_floor,p_sos,p_online,p_kaoqing,p_fence,baoliu4,baoliu12) VALUES(:p_tagid,(SELECT iconadress FROM tb_department WHERE departmentName = :p_department LIMIT 1),(SELECT power FROM tb_tag WHERE tag_id = :p_tagid LIMIT 1),:p_department,:p_name,:p_sex,:p_phone,now(),:p_minzu,:p_x,:p_y,:p_floor,:p_sos,:p_online,:p_kaoqing,:p_fence,:baoliu4,:baoliu12)"; |
| | | cs.tb_caozuo("tb_person", 1); |
| | | query = this.em.createNativeQuery(sql); |
| | | query.setParameter("p_tagid", person.getP_tagid()); |
| | |
| | | query.setParameter("p_online", person.getP_online()); |
| | | query.setParameter("p_kaoqing", person.getP_kaoqing()); |
| | | query.setParameter("p_fence", person.getP_fence()); |
| | | query.setParameter("baoliu4", person.getBaoliu4()); |
| | | query.setParameter("baoliu12", person.getBaoliu12()); |
| | | int executeUpdate = query.executeUpdate(); |
| | | return executeUpdate; |
| | | } |
| | | |
| | | @Transactional |
| | | public int renyuandaoru(tb_person person) { |
| | | String sql = null; |
| | | Query query = null; |
| | | sql = "UPDATE tb_person SET p_name=:p_name,p_sex=:p_sex,p_department=:p_department,p_phone=:p_phone WHERE p_tagid= :p_tagid"; |
| | | cs.tb_caozuo("tb_person", 3); |
| | | query = this.em.createNativeQuery(sql); |
| | | query.setParameter("p_tagid", person.getP_tagid()); |
| | | query.setParameter("p_department", person.getP_department()); |
| | | query.setParameter("p_name", person.getP_name()); |
| | | query.setParameter("p_sex", person.getP_sex()); |
| | | query.setParameter("p_phone", person.getP_phone()); |
| | | int executeUpdate = query.executeUpdate(); |
| | | return executeUpdate; |
| | | } |