qirong
2023-06-07 78c3c58e95590e8ff00d9240051fbb9536be485b
src/main/resources/mapper/DepartmentMapper.xml
@@ -7,6 +7,10 @@
        <result column="deleted" jdbcType="VARCHAR" property="deleted"/>
    </resultMap>
    <sql id="Base_Column_List">
        id, name,deleted
    </sql>
    <insert id="add" parameterType="com.mindskip.xzs.domain.Department" useGeneratedKeys="true" keyProperty="id">
        insert into t_department (name, deleted)
        values (#{name,jdbcType=VARCHAR}, #{deleted,jdbcType=VARCHAR})
@@ -30,4 +34,20 @@
        <include refid="Base_Column_List"/>
        from t_department where deleted=0
    </select>
    <select id="page" resultMap="BaseResultMap" parameterType="com.mindskip.xzs.viewmodel.admin.department.DepartmentResponseVM">
        SELECT
        <include refid="Base_Column_List"/>
        FROM t_department
        <where>
            and deleted=0
            <if test="id != null ">
                and id= #{id}
            </if>
            <if test="name != null ">
                and name like concat('%',#{name},'%')
            </if>
        </where>
    </select>
</mapper>