| | |
| | | <if test="name != null"> |
| | | name = #{name,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="adminId != null"> |
| | | admin_id = #{adminId}, |
| | | </if> |
| | | <if test="deleted != null"> |
| | | deleted = #{deleted,jdbcType=VARCHAR}, |
| | | </if> |
| | |
| | | <select id="getChilds" resultType="integer"> |
| | | WITH RECURSIVE temp_table AS ( |
| | | SELECT |
| | | id, name, parent_id,special,level FROM t_department WHERE id in <foreach collection="deptIds" open="(" item="deptId" close=")" separator=",">#{deptId}</foreach> |
| | | id, name, parent_id,special,level FROM t_department WHERE id in <foreach collection="deptIds" open="(" item="deptId" close=")" separator=",">#{deptId}</foreach> AND deleted = 0 |
| | | UNION ALL |
| | | SELECT |
| | | so.id, so.name, so.parent_id, so.special, so.level FROM t_department so INNER JOIN temp_table tb ON so.parent_id = tb.id |
| | | so.id, so.name, so.parent_id, so.special, so.level FROM t_department so INNER JOIN temp_table tb ON so.parent_id = tb.id AND so.deleted = 0 |
| | | ) |
| | | SELECT |
| | | DISTINCT id |
| | |
| | | <select id="getFather" resultType="integer"> |
| | | WITH RECURSIVE temp_table AS ( |
| | | SELECT |
| | | id, name, parent_id,special,level FROM t_department WHERE id = #{deptId} |
| | | id, name, parent_id,special,level FROM t_department WHERE id = #{deptId} AND deleted = 0 |
| | | UNION ALL |
| | | SELECT |
| | | so.id, so.name, so.parent_id, so.special, so.level FROM t_department so INNER JOIN temp_table tb ON so.id = tb.parent_id |
| | | so.id, so.name, so.parent_id, so.special, so.level FROM t_department so INNER JOIN temp_table tb ON so.id = tb.parent_id AND so.deleted = 0 |
| | | ) |
| | | SELECT |
| | | DISTINCT id |
| | |
| | | temp_table |
| | | </select> |
| | | |
| | | <select id="getLevelDeptList" resultType="com.mindskip.xzs.domain.vo.CascaderDataVO"> |
| | | SELECT id as value, name as label, parent_id, special, level FROM t_department WHERE level = #{level} AND deleted = 0 |
| | | </select> |
| | | |
| | | <select id="page1" resultType="com.mindskip.xzs.vo.SubjectVO"> |
| | | SELECT |
| | | id, name |
| | | FROM |
| | | t_subject |
| | | WHERE |
| | | deleted = 0 |
| | | <if test="query.name != null and query.name != ''"> |
| | | AND name like concat('%', #{query.name} , '%') |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |