All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.kedauis.system.mapper.SysDeptMapper.xml Maven / Gradle / Ivy

The newest version!
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.kedauis.system.dao.SysDeptMapper" >

    <select id="qryEnableDepts" resultType="com.kedauis.system.model.SysDept">
        SELECT
            *
        FROM
            sys_dept
        WHERE
            is_enable = '1'
        ORDER BY
            id ASC
    </select>
    <select id="qryAllDepts" resultType="com.kedauis.system.model.SysDept">
        SELECT
            *
        FROM
            sys_dept
        ORDER BY
            id ASC
    </select>
    <select id="qryDeptsByParentId" resultType="com.kedauis.system.model.SysDept">
        SELECT
            *
        FROM
            sys_dept
        WHERE
            dept_parent_id = #{deptParentId,jdbcType=INTEGER}
    </select>

    <select id="qryDeptByDeptId" resultType="com.kedauis.system.model.SysDept" parameterType="java.lang.String">
        SELECT
            *
        FROM
            sys_dept
        WHERE
            dept_id = #{deptID,jdbcType=VARCHAR}
    </select>

    <delete id="delDept" parameterType="java.lang.Integer">
        UPDATE sys_dept SET is_enable =  '0' WHERE id = #{id,jdbcType=INTEGER}
    </delete>

    <insert id="insDept" parameterType="com.kedauis.system.model.SysDept">
        INSERT INTO sys_dept (
            dept_id,
            dept_name,
            dept_parent_id,
            dept_phone,
            dept_desc,
            is_enable
        )
        VALUES
            (#{deptId,jdbcType=INTEGER}, #{deptName,jdbcType=VARCHAR}, #{deptParentId,jdbcType=INTEGER}, #{deptPhone,jdbcType=VARCHAR}, #{deptDesc,jdbcType=VARCHAR}, #{isEnable,jdbcType=VARCHAR})
    </insert>
    
    <update id="updDept" parameterType="com.kedauis.system.model.SysDept">
        UPDATE sys_dept
        SET dept_id = #{deptId,jdbcType=INTEGER},
         dept_name = #{deptName,jdbcType=VARCHAR},
         dept_parent_id = #{deptParentId,jdbcType=INTEGER},
         dept_phone = #{deptPhone,jdbcType=VARCHAR},
         dept_desc = #{deptDesc,jdbcType=VARCHAR},
         is_enable =  #{isEnable,jdbcType=VARCHAR}
         WHERE id = #{id,jdbcType=INTEGER}
    </update>

</mapper>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy