qirong
2023-06-13 73f0e39ec9a58d585d68ecd07ec69b7c7b540c52
src/main/resources/mapper/DepartmentMapper.xml
@@ -8,7 +8,8 @@
    </resultMap>
    <sql id="Base_Column_List">
        id, name,deleted
        id
        , name,deleted
    </sql>
    <insert id="add" parameterType="com.mindskip.xzs.domain.Department" useGeneratedKeys="true" keyProperty="id">
@@ -17,13 +18,13 @@
    </insert>
    <update id="update" parameterType="com.mindskip.xzs.domain.Department">
        update t_user
        update t_department
        <set>
            <if test="name != null">
                name = #{name,jdbcType=VARCHAR},
            </if>
            <if test="deleted != null">
                name = #{deleted,jdbcType=VARCHAR},
                deleted = #{deleted,jdbcType=VARCHAR},
            </if>
        </set>
        where id = #{id,jdbcType=INTEGER}
@@ -35,7 +36,15 @@
        from t_department where deleted=0
    </select>
    <select id="page" resultMap="BaseResultMap" parameterType="com.mindskip.xzs.viewmodel.admin.department.DepartmentResponseVM">
    <select id="getById" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from t_department where deleted=0
        and id = #{id}
    </select>
    <select id="page" resultMap="BaseResultMap"
            parameterType="com.mindskip.xzs.viewmodel.admin.department.DepartmentResponseVM">
        SELECT
        <include refid="Base_Column_List"/>
        FROM t_department
@@ -50,4 +59,10 @@
        </where>
    </select>
    <select id="getName" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from t_department where deleted=0 and name = #{name}
    </select>
</mapper>