| | |
| | | private String name; |
| | | |
| | | /** |
| | | * 上级部门ID |
| | | */ |
| | | private Integer parentId; |
| | | |
| | | /** |
| | | * 部门管理员 |
| | | */ |
| | | private List<Integer> adminId; |
| | |
| | | <id column="id" jdbcType="INTEGER" property="id"/> |
| | | <result column="name" jdbcType="VARCHAR" property="name"/> |
| | | <result column="deleted" jdbcType="VARCHAR" property="deleted"/> |
| | | <result column="parent_id" property="parentId"/> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | | id |
| | | , name,deleted |
| | | , name,deleted,parent_id |
| | | </sql> |
| | | |
| | | <insert id="add" parameterType="com.mindskip.xzs.domain.Department" useGeneratedKeys="true" keyProperty="id"> |
| | |
| | | <if test="adminId != null"> |
| | | admin_id = #{adminId}, |
| | | </if> |
| | | <if test="parentId != null"> |
| | | parent_id = #{parentId}, |
| | | </if> |
| | | <if test="deleted != null"> |
| | | deleted = #{deleted,jdbcType=VARCHAR}, |
| | | </if> |
| | |
| | | <select id="gets" resultMap="BaseResultMap"> |
| | | SELECT |
| | | td.id, |
| | | td.name |
| | | td.name, |
| | | td.parent_id |
| | | FROM |
| | | t_department td |
| | | WHERE |
| | |
| | | <select id="getById" resultMap="BaseResultMap"> |
| | | SELECT |
| | | td.id, |
| | | td.name |
| | | td.name, |
| | | td.parent_id |
| | | FROM |
| | | t_department td |
| | | WHERE |
| | |
| | | parameterType="com.mindskip.xzs.viewmodel.admin.department.DepartmentResponseVM"> |
| | | SELECT |
| | | td.id, |
| | | td.name |
| | | td.name, |
| | | td.parent_id |
| | | FROM |
| | | t_department td |
| | | <where> |
| | |
| | | SELECT |
| | | td.id, |
| | | td.name, |
| | | td.parent_id, |
| | | td.admin_id as adminId, |
| | | tu.real_name as adminName |
| | | FROM |