AdministrativeInfoMapper.xml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.boman.web.core.mapper.AdministrativeInfoMapper">
  6. <resultMap type="AdministrativeInfo" id="AdministrativeInfoResult">
  7. <result property="id" column="id" />
  8. <result property="parentId" column="parent_id" />
  9. <result property="administrativeName" column="administrative_name" />
  10. <result property="status" column="status" />
  11. <result property="orderNum" column="order_num" />
  12. <result property="createBy" column="create_by" />
  13. <result property="createTime" column="create_time" />
  14. <result property="updateBy" column="update_by" />
  15. <result property="updateTime" column="update_time" />
  16. <result property="isDel" column="is_del" />
  17. <result property="ancestors" column="ancestors" />
  18. <result property="remark" column="remark" />
  19. </resultMap>
  20. <sql id="selectAdministrativeInfoVo">
  21. select d.id,d.parent_id, d.dept_name as administrative_name,d.ancestors as ancestors , d.status, d.create_by, d.create_time, d.update_by, d.update_time from sys_dept d
  22. </sql>
  23. <select id="selectAdministrativeInfoList" parameterType="com.boman.web.core.domain.AdministrativeInfo" resultMap="AdministrativeInfoResult">
  24. <include refid="selectAdministrativeInfoVo"/>
  25. <where>
  26. d.del_flag = '0'
  27. <if test="parentId != null and parentId != 0">
  28. AND d.parent_id = #{parentId}
  29. </if>
  30. <if test="administrativeName != null and administrativeName != ''">
  31. AND d.dept_name like concat('%', #{administrativeName}, '%')
  32. </if>
  33. <if test="status != null and status != ''">
  34. AND d.status = #{status}
  35. </if>
  36. </where>
  37. <!-- 数据范围过滤 -->
  38. ${params.dataScope}
  39. order by d.parent_id, d.order_num
  40. </select>
  41. </mapper>