You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
92 lines
4.4 KiB
92 lines
4.4 KiB
<?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="org.springblade.modules.operation.mapper.OperationSiteEmployeeMapper">
|
|
|
|
<!-- 通用查询映射结果 -->
|
|
<resultMap id="operationSiteEmployeeResultMap" type="org.springblade.modules.operation.pojo.entity.OperationSiteEmployeeEntity">
|
|
<result column="id" property="id"/>
|
|
<result column="user_id" property="userId"/>
|
|
<result column="name" property="name"/>
|
|
<result column="mobile" property="mobile"/>
|
|
<result column="hiredate" property="hiredate"/>
|
|
<result column="update_time" property="updateTime"/>
|
|
<result column="create_time" property="createTime"/>
|
|
<result column="role" property="role"/>
|
|
<result column="category" property="category"/>
|
|
<result column="status" property="status"/>
|
|
<result column="create_by" property="createBy"/>
|
|
<result column="provinces" property="provinces"/>
|
|
<result column="site_id" property="siteId"/>
|
|
<result column="years" property="years"/>
|
|
<result column="license_img" property="licenseImg"/>
|
|
<result column="qrcode" property="qrcode"/>
|
|
</resultMap>
|
|
|
|
|
|
<select id="selectOperationSiteEmployeePage" resultType="org.springblade.modules.operation.pojo.vo.OperationSiteEmployeeVO">
|
|
select e.*,u.account as loginName from sf_operation_site_employee e
|
|
LEFT JOIN blade_user u on e.user_id = u.id
|
|
where e.is_deleted != 1 and e.site_id=#{operationSiteEmployee.siteId}
|
|
<if test="operationSiteEmployee.isDeleted !=null and operationSiteEmployee.isDeleted != ''">
|
|
and e.is_deleted = #{operationSiteEmployee.isDeleted}
|
|
</if>
|
|
<if test="operationSiteEmployee.role !=null and operationSiteEmployee.role != ''">
|
|
<choose>
|
|
<when test="operationSiteEmployee.role == 2">
|
|
and e.role <> 1
|
|
</when>
|
|
<otherwise>
|
|
and e.role = #{operationSiteEmployee.role}
|
|
</otherwise>
|
|
</choose>
|
|
|
|
</if>
|
|
<if test="operationSiteEmployee.name !=null and operationSiteEmployee.name != ''">
|
|
and e.name like concat('%', #{operationSiteEmployee.name}, '%')
|
|
</if>
|
|
<if test="operationSiteEmployee.isDeleted !=null and operationSiteEmployee.isDeleted != ''">
|
|
and e.is_deleted = #{operationSiteEmployee.isDeleted}
|
|
</if>
|
|
</select>
|
|
|
|
|
|
<select id="exportOperationSiteEmployee" resultType="org.springblade.modules.operation.excel.OperationSiteEmployeeExcel">
|
|
SELECT * FROM sf_operation_site_employee ${ew.customSqlSegment}
|
|
</select>
|
|
|
|
<select id="findEmpCount" resultType="java.lang.Long">
|
|
select count(*) from sf_operation_site_employee where site_id=#{siteId} and is_deleted = 0
|
|
</select>
|
|
<select id="findSiteIdByUserId" resultType="java.lang.String">
|
|
select site_id from sf_operation_site_employee where user_id=#{userId} and is_deleted = 0
|
|
</select>
|
|
|
|
|
|
<select id="findEmpAuthByUserId" resultType="org.springblade.modules.operation.pojo.vo.EmpAuthVo">
|
|
select id,site_id,provinces,city,area,role from sf_operation_site_employee where user_id=#{userId} and is_deleted = 0
|
|
</select>
|
|
|
|
<select id="getSiteEmployee" resultType="org.springblade.modules.operation.pojo.vo.OperationSiteEmployeeVO">
|
|
SELECT e.*,u.account as loginName
|
|
FROM sf_operation_site_employee e
|
|
LEFT JOIN blade_user u on e.user_id = u.id
|
|
WHERE e.is_deleted != 1 and e.id in
|
|
<foreach collection="id.split(',')" item="item" open="(" close=")" separator=",">
|
|
#{item}
|
|
</foreach>
|
|
LIMIT 1
|
|
</select>
|
|
|
|
<select id="findByEmpIds" resultType="org.springblade.modules.operation.pojo.vo.OperationEmpVo">
|
|
SELECT GROUP_CONCAT(e.name) AS empName, GROUP_CONCAT(e.mobile) AS empMobile
|
|
FROM `sf_operation_site_employee` e WHERE e.id IN
|
|
<foreach collection="empIds.split(',')" item="item" open="(" close=")" separator=",">
|
|
#{item}
|
|
</foreach>
|
|
</select>
|
|
|
|
<select id="findByuserId" resultType="org.springblade.modules.operation.pojo.entity.OperationSiteEmployeeEntity">
|
|
select * from sf_operation_site_employee where user_id=#{userId} and is_deleted = 0
|
|
</select>
|
|
</mapper>
|