<?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.gk.hotwork.Mapper.DepartmentInfoMapper" >
|
<resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.DepartmentInfo" >
|
<!-- -->
|
<id column="id" property="id" jdbcType="BIGINT" />
|
<result column="department" property="department" jdbcType="VARCHAR" />
|
<result column="issafety" property="issafety" jdbcType="TINYINT" />
|
<result column="isanalysis" property="isanalysis" jdbcType="TINYINT" />
|
<result column="isdel" property="isdel" jdbcType="TINYINT" />
|
<result column="createdby" property="createdby" jdbcType="VARCHAR" />
|
<result column="createddate" property="createddate" jdbcType="TIMESTAMP" />
|
<result column="lastmodifiedby" property="lastmodifiedby" jdbcType="VARCHAR" />
|
<result column="lastmodifieddate" property="lastmodifieddate" jdbcType="TIMESTAMP" />
|
</resultMap>
|
<sql id="Base_Column_List" >
|
id, department, issafety, isanalysis, isdel, createdby,createddate, lastmodifiedby, lastmodifieddate
|
</sql>
|
<select id="selectDataGrid" resultType="com.gk.hotwork.Domain.Vo.DepartmentVo">
|
select *
|
from department
|
<where>
|
1=1
|
and isdel = 0
|
<if test="condition.department != null and condition.department !=''">
|
and department like concat('%',#{condition.department},'%')
|
</if>
|
</where>
|
</select>
|
<select id="selectExistByName" resultType="com.gk.hotwork.Domain.DepartmentInfo">
|
select *
|
from department
|
<where>
|
1=1
|
and isdel = 0
|
and department = #{department}
|
<if test="id != null">
|
and id != #{id}
|
</if>
|
</where>
|
</select>
|
<select id="selectByAll" resultType="com.gk.hotwork.Domain.Vo.DepartmentVo">
|
select *
|
from department
|
where isdel = 0
|
</select>
|
<select id="selectSafety" resultType="com.gk.hotwork.Domain.DepartmentInfo"> todo
|
select *
|
from department
|
where isdel = 0
|
and issafety = 1
|
<if test="id != null">
|
and id != #{id}
|
</if>
|
</select>
|
<select id="selectCountForExam" parameterType="java.util.Map" resultType="java.lang.Integer">
|
select count(0)
|
from department
|
where isdel = 0
|
<if test="name != null and name != ''">
|
and department like concat("%",#{name},"%")
|
</if>
|
</select>
|
<select id="selectPageForExam" parameterType="java.util.Map" resultMap="BaseResultMap">
|
select *
|
from department
|
where isdel = 0
|
<if test="name != null and name != ''">
|
and department like concat("%",#{name},"%")
|
</if>
|
<if test="first != null and pageSize != null">
|
limit #{first},#{pageSize}
|
</if>
|
</select>
|
|
<!--void getInfoByName(String departmentName);-->
|
<select id="getInfoByName" resultType="com.gk.hotwork.Domain.DepartmentInfo">
|
select * from department where isdel =0 and department = #{departmentName}
|
</select>
|
|
<!--DepartmentInfo getDepartmentInfoById(Long depId);-->
|
<select id="getDepartmentInfoById" resultType="com.gk.hotwork.Domain.DepartmentInfo">
|
select * from department where isdel =0 and id = #{depId}
|
</select>
|
<select id="listDepByDepIds" resultType="com.gk.hotwork.Domain.DepartmentInfo">
|
select * from department
|
where isdel =0
|
and id in
|
<foreach collection="list" item="id" open="(" close=")" separator=",">
|
#{id}
|
</foreach>
|
|
</select>
|
<!-- List<DepartmentInfo> listDepartmentInfoById();-->
|
<select id="listDepartmentInfoById" resultMap="BaseResultMap">
|
select * from department where isdel =0
|
</select>
|
</mapper>
|