12345678910111213141516171819202122232425262728293031 |
- <?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.zglc.kg.dao.DepartmentDao">
- <!-- 可根据自己的需求,是否要使用 -->
- <resultMap type="com.zglc.kg.entity.DepartmentEntity" id="departmentMap">
- <result property="id" column="id"/>
- <result property="parentId" column="parent_id"/>
- <result property="parentName" column="parent_name"/>
- <result property="departmentName" column="department_name"/>
- <result property="masterId" column="master_id"/>
- <result property="masterName" column="master_name"/>
- <result property="remark" column="remark"/>
- </resultMap>
- <select id="listAll" resultMap="departmentMap">
- select *
- from t_department
- </select>
- <select id="listsub" parameterType="integer" resultMap="departmentMap">
- select *
- from t_department where parent_id =#{id , jdbcType=INTEGER}
- </select>
- <select id="findByName" parameterType="String" resultMap="departmentMap">
- select * from t_department where
- department_name like #{name}
- </select>
- </mapper>
|