You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
udiwms-java/api-admin/src/main/resources/mybatis/mapper/auth/DeptDao.xml

56 lines
2.1 KiB
XML

3 years ago
<?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.glxp.api.admin.dao.auth.DeptDao">
<select id="filterDepts" parameterType="com.glxp.api.admin.req.auth.FilterDeptRequest"
resultType="com.glxp.api.admin.entity.auth.DeptEntity">
SELECT *
FROM auth_dept
<where>
3 years ago
<if test="flag != null and flag != ''">
and flag = #{flag}
</if>
3 years ago
<if test="name != null and '' != name">
AND `name` LIKE CONCAT('%',#{name},'%')
</if>
<if test="lastUpdateTime!=null and lastUpdateTime!=''">
<![CDATA[ and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]>
</if>
3 years ago
</where>
</select>
<insert id="insertDept" keyProperty="id" parameterType="com.glxp.api.admin.entity.auth.DeptEntity">
INSERT INTO auth_dept(`name`, `flag`, `remark`, updateTime, code)
values (#{name},
#{flag},
#{remark}, #{updateTime}, #{code})
</insert>
<update id="updateDept" parameterType="com.glxp.api.admin.entity.auth.DeptEntity">
UPDATE auth_dept
<trim prefix="set" suffixOverrides=",">
<if test="name != null">`name`=#{name},</if>
<if test="flag != null">`flag`=#{flag},</if>
<if test="remark != null">remark=#{remark},</if>
<if test="code != null">code=#{code},</if>
<if test="updateTime != null">updateTime=#{updateTime},</if>
</trim>
WHERE id=#{id}
</update>
<delete id="deleteById" parameterType="java.lang.Integer">
delete
from auth_dept
where id = #{id}
</delete>
<delete id="deleteAll">
delete
from auth_dept
</delete>
<select id="selectByCode" resultType="com.glxp.api.admin.entity.auth.DeptEntity">
select * from auth_dept where code = #{code}
</select>
3 years ago
</mapper>