<?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.stylefeng.guns.modular.system.dao.TGroupMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.TGroup">
|
<id column="id" property="id" />
|
<result column="name" property="name" />
|
<result column="sales_id" property="salesId" />
|
<result column="department_id" property="departmentId" />
|
</resultMap>
|
|
<!-- 通用查询结果列 -->
|
<sql id="Base_Column_List">
|
id, name, sales_id, department_id
|
</sql>
|
<select id="getList" resultType="com.stylefeng.guns.modular.system.model.TGroupVo">
|
select t1.* ,t2.fullname as departmentName,t3.`name` as salesName from t_group t1 left JOIN sys_dept t2 on t1.department_id = t2.id
|
left join sys_user t3 on t1.sales_id = t3.id where t1.remove=0
|
<if test="name !=null and name !=''">
|
and t1.name like concat("%",#{name},"%")
|
</if>
|
<if test="departmentId !=null and departmentId !=''">
|
and t1.department_id =#{departmentId}
|
</if>
|
<if test="sales !=null and sales !=''">
|
and t1.sales_id =#{sales}
|
</if>
|
</select>
|
|
</mapper>
|