| | |
| | | @JoinColumn(name="level_id") |
| | | private UserLevel userLevel; |
| | | |
| | | // @ManyToOne(targetEntity = UserDepartment.class, fetch = FetchType.LAZY) |
| | | // @JoinColumn(name="department_id") |
| | | // private UserDepartment userDepartment; |
| | | |
| | | public User() { |
| | | } |
| | | |
| | |
| | | package kr.wisestone.owl.domain; |
| | | |
| | | import javax.persistence.GeneratedValue; |
| | | import javax.persistence.GenerationType; |
| | | import javax.persistence.Id; |
| | | import javax.persistence.*; |
| | | import java.io.Serializable; |
| | | |
| | | @Entity |
| | | public class UserDepartment extends BaseEntity implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | |
| | | import kr.wisestone.owl.util.*; |
| | | import kr.wisestone.owl.vo.*; |
| | | import kr.wisestone.owl.web.condition.UserCondition; |
| | | import kr.wisestone.owl.web.form.DepartmentForm; |
| | | import kr.wisestone.owl.web.form.UserForm; |
| | | import kr.wisestone.owl.web.view.ExcelView; |
| | | import org.apache.commons.validator.routines.EmailValidator; |
| | |
| | | |
| | | CREATE TABLE `department`( |
| | | `id` BIGINT(11) AUTO_INCREMENT, |
| | | `department_name` VARCHAR(50) NULL, |
| | | `department_name` VARCHAR(50) NOT NULL, |
| | | `department_description` VARCHAR(255) NULL, |
| | | `register_id` BIGINT(20) NOT NULL, |
| | | `register_date` TIMESTAMP NULL, |
| | |
| | | |
| | | CREATE TABLE `user_department`( |
| | | `id` BIGINT(11) AUTO_INCREMENT, |
| | | `department_id` VARCHAR(50) NOT NULL, |
| | | `department_id` VARCHAR(50) NULL, |
| | | `user_id` VARCHAR(50) NULL, |
| | | `register_id` BIGINT(20) NOT NULL, |
| | | `register_date` TIMESTAMP NULL, |
| | | `modify_id` BIGINT(20) NOT NULL, |
| | |
| | | d.id as id, |
| | | d.department_name as departmentName, |
| | | d.department_description as departmentDescription, |
| | | (SELECT COUNT(u.id) FROM user u WHERE d.id = u.department_id) AS departmentCount |
| | | (SELECT COUNT(d.id) FROM user_department ud WHERE d.id = ud.department_id) AS departmentCount |
| | | FROM |
| | | department d |
| | | WHERE 1=1 |