mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-11-12 05:33:48 +08:00
v3.9.0【优化】typescript版本;【优化】App端消息;【优化】弹出层z-index;
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
<?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="net.lab1024.sa.admin.module.business.category.dao.CategoryDao">
|
||||
|
||||
<!-- 根据父级id 查询子类 -->
|
||||
<select id="queryByParentId"
|
||||
resultType="net.lab1024.sa.admin.module.business.category.domain.entity.CategoryEntity">
|
||||
SELECT * FROM t_category
|
||||
WHERE
|
||||
parent_id IN
|
||||
<foreach collection="parentIdList" open="(" separator="," close=")" item="id">#{id}</foreach>
|
||||
AND deleted_flag = #{deletedFlag}
|
||||
ORDER BY sort ASC
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 根据父级id 查询子类 -->
|
||||
<select id="queryByParentIdAndType"
|
||||
resultType="net.lab1024.sa.admin.module.business.category.domain.entity.CategoryEntity">
|
||||
SELECT * FROM t_category
|
||||
WHERE
|
||||
parent_id IN
|
||||
<foreach collection="parentIdList" open="(" separator="," close=")" item="id">#{id}</foreach>
|
||||
AND category_type = #{categoryType}
|
||||
AND deleted_flag = #{deletedFlag}
|
||||
ORDER BY sort ASC
|
||||
</select>
|
||||
|
||||
<select id="queryByType"
|
||||
resultType="net.lab1024.sa.admin.module.business.category.domain.entity.CategoryEntity">
|
||||
SELECT * FROM t_category
|
||||
WHERE category_type = #{categoryType}
|
||||
AND deleted_flag = #{deletedFlag}
|
||||
ORDER BY sort ASC
|
||||
</select>
|
||||
|
||||
<!-- 查看类目 -->
|
||||
<select id="selectOne" resultType="net.lab1024.sa.admin.module.business.category.domain.entity.CategoryEntity">
|
||||
SELECT * FROM t_category
|
||||
<where>
|
||||
<if test="categoryType != null">
|
||||
AND category_type = #{categoryType}
|
||||
</if>
|
||||
<if test="parentId != null">
|
||||
AND parent_id = #{parentId}
|
||||
</if>
|
||||
<if test="categoryName != null">
|
||||
AND category_name = #{categoryName}
|
||||
</if>
|
||||
<if test="deletedFlag != null">
|
||||
AND deleted_flag = #{deletedFlag}
|
||||
</if>
|
||||
</where>
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
<select id="selectByTypeAndId"
|
||||
resultType="net.lab1024.sa.admin.module.business.category.domain.entity.CategoryEntity">
|
||||
select * from t_category where category_type = #{categoryType} and category_id = #{categoryId}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,41 @@
|
||||
<?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="net.lab1024.sa.admin.module.business.goods.dao.GoodsDao">
|
||||
<update id="batchUpdateDeleted">
|
||||
update t_goods
|
||||
set deleted_flag = #{deletedFlag}
|
||||
WHERE goods_id IN
|
||||
<foreach collection="goodsIdList" open="(" close=")" separator="," item="item">
|
||||
#{item}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<!-- 分页 查询商品 -->
|
||||
<select id="query" resultType="net.lab1024.sa.admin.module.business.goods.domain.vo.GoodsVO">
|
||||
SELECT * FROM t_goods
|
||||
<where>
|
||||
<if test="query.searchWord != null and query.searchWord !=''">
|
||||
INSTR(goods_name,#{query.searchWord})
|
||||
</if>
|
||||
<if test="query.place != null">
|
||||
AND INSTR(place,#{query.place})
|
||||
</if>
|
||||
<if test="query.goodsStatus != null">
|
||||
AND goods_status = #{query.goodsStatus}
|
||||
</if>
|
||||
<if test="query.categoryId != null">
|
||||
AND category_id = #{query.categoryId}
|
||||
</if>
|
||||
<if test="query.shelvesFlag != null">
|
||||
AND shelves_flag = #{query.shelvesFlag}
|
||||
</if>
|
||||
<if test="query.deletedFlag != null">
|
||||
AND deleted_flag = #{query.deletedFlag}
|
||||
</if>
|
||||
</where>
|
||||
<if test="query.sortItemList == null or query.sortItemList.size == 0">
|
||||
ORDER BY goods_id DESC
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,58 @@
|
||||
<?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="net.lab1024.sa.admin.module.business.oa.bank.BankDao">
|
||||
<update id="deleteBank">
|
||||
UPDATE t_oa_bank
|
||||
SET deleted_flag = #{deletedFlag}
|
||||
WHERE bank_id = #{bankId}
|
||||
</update>
|
||||
<select id="queryByAccountNumber"
|
||||
resultType="net.lab1024.sa.admin.module.business.oa.bank.domain.BankEntity">
|
||||
SELECT *
|
||||
FROM t_oa_bank
|
||||
WHERE enterprise_id = #{enterpriseId}
|
||||
AND account_number = #{accountNumber}
|
||||
AND deleted_flag = #{deletedFlag}
|
||||
<if test="excludeBankId != null">
|
||||
AND bank_id != #{excludeBankId}
|
||||
</if>
|
||||
</select>
|
||||
<select id="queryPage" resultType="net.lab1024.sa.admin.module.business.oa.bank.domain.BankVO">
|
||||
SELECT t_oa_bank.*,
|
||||
t_oa_enterprise.enterprise_name
|
||||
FROM t_oa_bank
|
||||
LEFT JOIN t_oa_enterprise ON t_oa_bank.enterprise_id = t_oa_enterprise.enterprise_id
|
||||
<where>
|
||||
t_oa_bank.deleted_flag = #{queryForm.deletedFlag}
|
||||
<if test="queryForm.keywords != null and queryForm.keywords != ''">
|
||||
AND (INSTR(t_oa_bank.bank_name,#{queryForm.keywords}) OR
|
||||
INSTR(t_oa_bank.account_name,#{queryForm.keywords}) OR
|
||||
INSTR(t_oa_bank.account_number,#{queryForm.keywords}) OR
|
||||
INSTR(t_oa_bank.create_user_name,#{queryForm.keywords}))
|
||||
</if>
|
||||
<if test="queryForm.startTime != null">
|
||||
AND DATE_FORMAT(t_oa_bank.create_time, '%Y-%m-%d') >= #{queryForm.startTime}
|
||||
</if>
|
||||
<if test="queryForm.endTime != null">
|
||||
AND DATE_FORMAT(t_oa_bank.create_time, '%Y-%m-%d') <= #{queryForm.endTime}
|
||||
</if>
|
||||
<if test="queryForm.disabledFlag != null">
|
||||
AND t_oa_bank.disabled_flag = #{queryForm.disabledFlag}
|
||||
</if>
|
||||
<if test="queryForm.enterpriseId != null">
|
||||
AND t_oa_bank.enterprise_id = #{queryForm.enterpriseId}
|
||||
</if>
|
||||
</where>
|
||||
<if test="queryForm.sortItemList == null or queryForm.sortItemList.size == 0">
|
||||
ORDER BY t_oa_bank.create_time DESC
|
||||
</if>
|
||||
</select>
|
||||
<select id="getDetail" resultType="net.lab1024.sa.admin.module.business.oa.bank.domain.BankVO">
|
||||
SELECT t_oa_bank.*,
|
||||
t_oa_enterprise.enterprise_name
|
||||
FROM t_oa_bank
|
||||
LEFT JOIN t_oa_enterprise ON t_oa_bank.enterprise_id = t_oa_enterprise.enterprise_id
|
||||
WHERE t_oa_bank.bank_id = #{bankId}
|
||||
AND t_oa_bank.deleted_flag = #{deletedFlag}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,94 @@
|
||||
<?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="net.lab1024.sa.admin.module.business.oa.enterprise.dao.EnterpriseEmployeeDao">
|
||||
|
||||
<delete id="deleteByEnterpriseAndEmployeeIdList">
|
||||
delete from t_oa_enterprise_employee where enterprise_id = #{enterpriseId} and employee_id in
|
||||
<foreach collection="employeeIdList" item="item" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByEmployeeId">
|
||||
delete from t_oa_enterprise_employee where employee_id = #{employeeId}
|
||||
</delete>
|
||||
|
||||
<select id="selectByEnterpriseId"
|
||||
resultType="net.lab1024.sa.admin.module.business.oa.enterprise.domain.entity.EnterpriseEmployeeEntity">
|
||||
select * from t_oa_enterprise_employee where enterprise_id = #{enterpriseId}
|
||||
</select>
|
||||
|
||||
<select id="selectByEnterpriseAndEmployeeIdList"
|
||||
resultType="net.lab1024.sa.admin.module.business.oa.enterprise.domain.entity.EnterpriseEmployeeEntity">
|
||||
select * from t_oa_enterprise_employee where enterprise_id = #{enterpriseId} and employee_id in
|
||||
<foreach collection="employeeIdList" item="item" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="selectByEmployeeIdList"
|
||||
resultType="net.lab1024.sa.admin.module.business.oa.enterprise.domain.vo.EnterpriseEmployeeVO">
|
||||
select
|
||||
t_oa_enterprise_employee.*,
|
||||
t_oa_enterprise.enterprise_name,
|
||||
t_employee.actual_name as employeeName
|
||||
from t_oa_enterprise_employee
|
||||
left join t_oa_enterprise on t_oa_enterprise_employee.enterprise_id = t_oa_enterprise.enterprise_id
|
||||
left join t_employee on t_oa_enterprise_employee.employee_id = t_employee.employee_id
|
||||
where t_oa_enterprise_employee.employee_id in
|
||||
<foreach collection="employeeIdList" item="item" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="selectByEnterpriseIdList"
|
||||
resultType="net.lab1024.sa.admin.module.business.oa.enterprise.domain.vo.EnterpriseEmployeeVO">
|
||||
select
|
||||
t_oa_enterprise_employee.*,
|
||||
t_oa_enterprise.enterprise_name,
|
||||
t_employee.*,
|
||||
t_employee.actual_name as employeeName
|
||||
from t_oa_enterprise_employee
|
||||
left join t_oa_enterprise on t_oa_enterprise_employee.enterprise_id = t_oa_enterprise.enterprise_id
|
||||
left join t_employee on t_oa_enterprise_employee.employee_id = t_employee.employee_id
|
||||
where t_oa_enterprise_employee.enterprise_id in
|
||||
<foreach collection="enterpriseIdList" item="item" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="selectEnterpriseIdByEmployeeId" resultType="java.lang.Long">
|
||||
select enterprise_id from t_oa_enterprise_employee where employee_id = #{employeeId}
|
||||
</select>
|
||||
|
||||
<select id="selectEmployeeIdByEnterpriseIdList" resultType="java.lang.Long">
|
||||
select employee_id from t_oa_enterprise_employee where enterprise_id in
|
||||
<foreach collection="enterpriseIdList" item="item" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
<select id="queryPageEmployeeList"
|
||||
resultType="net.lab1024.sa.admin.module.business.oa.enterprise.domain.vo.EnterpriseEmployeeVO">
|
||||
select
|
||||
t_oa_enterprise_employee.*,
|
||||
t_oa_enterprise.enterprise_name,
|
||||
t_employee.*,
|
||||
t_employee.actual_name as employeeName
|
||||
from t_oa_enterprise_employee
|
||||
left join t_oa_enterprise on t_oa_enterprise_employee.enterprise_id = t_oa_enterprise.enterprise_id
|
||||
left join t_employee on t_oa_enterprise_employee.employee_id = t_employee.employee_id
|
||||
where t_oa_enterprise_employee.enterprise_id = #{queryForm.enterpriseId}
|
||||
<if test="queryForm.keyword != null and queryForm.keyword != ''">
|
||||
AND (
|
||||
INSTR(t_employee.actual_name,#{queryForm.keyword})
|
||||
OR INSTR(t_employee.phone,#{queryForm.keyword})
|
||||
OR INSTR(t_employee.login_name,#{queryForm.keyword})
|
||||
)
|
||||
</if>
|
||||
<if test="queryForm.deletedFlag != null">
|
||||
AND t_employee.deleted_flag = #{queryForm.deletedFlag}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,89 @@
|
||||
<?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="net.lab1024.sa.admin.module.business.oa.enterprise.dao.EnterpriseDao">
|
||||
<update id="deleteEnterprise">
|
||||
UPDATE t_oa_enterprise
|
||||
SET deleted_flag = #{deletedFlag}
|
||||
WHERE enterprise_id = #{enterpriseId}
|
||||
</update>
|
||||
<select id="queryByEnterpriseName"
|
||||
resultType="net.lab1024.sa.admin.module.business.oa.enterprise.domain.entity.EnterpriseEntity">
|
||||
SELECT *
|
||||
FROM t_oa_enterprise
|
||||
WHERE enterprise_name = #{enterpriseName}
|
||||
AND deleted_flag = #{deletedFlag}
|
||||
<if test="excludeEnterpriseId != null">
|
||||
AND enterprise_id != #{excludeEnterpriseId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="queryPage"
|
||||
resultType="net.lab1024.sa.admin.module.business.oa.enterprise.domain.vo.EnterpriseVO">
|
||||
SELECT t_oa_enterprise.*
|
||||
FROM t_oa_enterprise
|
||||
<where>
|
||||
deleted_flag = #{queryForm.deletedFlag}
|
||||
<if test="queryForm.keywords != null and queryForm.keywords != ''">
|
||||
AND (INSTR(enterprise_name,#{queryForm.keywords}) OR INSTR(contact,#{queryForm.keywords}) OR
|
||||
INSTR(contact_phone,#{queryForm.keywords}) OR INSTR(create_user_name,#{queryForm.keywords}))
|
||||
</if>
|
||||
<if test="queryForm.startTime != null">
|
||||
AND DATE_FORMAT(create_time, '%Y-%m-%d') >= #{queryForm.startTime}
|
||||
</if>
|
||||
<if test="queryForm.endTime != null">
|
||||
AND DATE_FORMAT(create_time, '%Y-%m-%d') <= #{queryForm.endTime}
|
||||
</if>
|
||||
<if test="queryForm.disabledFlag != null">
|
||||
AND disabled_flag = #{queryForm.disabledFlag}
|
||||
</if>
|
||||
</where>
|
||||
<if test="queryForm.sortItemList == null or queryForm.sortItemList.size == 0">
|
||||
ORDER BY create_time DESC
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectExcelExportData"
|
||||
resultType="net.lab1024.sa.admin.module.business.oa.enterprise.domain.vo.EnterpriseExcelVO">
|
||||
SELECT t_oa_enterprise.*
|
||||
FROM t_oa_enterprise
|
||||
<where>
|
||||
deleted_flag = #{queryForm.deletedFlag}
|
||||
<if test="queryForm.keywords != null and queryForm.keywords != ''">
|
||||
AND (INSTR(enterprise_name,#{queryForm.keywords}) OR INSTR(contact,#{queryForm.keywords}) OR
|
||||
INSTR(contact_phone,#{queryForm.keywords}) OR INSTR(create_user_name,#{queryForm.keywords}))
|
||||
</if>
|
||||
<if test="queryForm.startTime != null">
|
||||
AND DATE_FORMAT(create_time, '%Y-%m-%d') >= #{queryForm.startTime}
|
||||
</if>
|
||||
<if test="queryForm.endTime != null">
|
||||
AND DATE_FORMAT(create_time, '%Y-%m-%d') <= #{queryForm.endTime}
|
||||
</if>
|
||||
<if test="queryForm.disabledFlag != null">
|
||||
AND disabled_flag = #{queryForm.disabledFlag}
|
||||
</if>
|
||||
</where>
|
||||
<if test="queryForm.sortItemList == null or queryForm.sortItemList.size == 0">
|
||||
ORDER BY create_time DESC
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="queryList"
|
||||
resultType="net.lab1024.sa.admin.module.business.oa.enterprise.domain.vo.EnterpriseListVO">
|
||||
SELECT enterprise_id, enterprise_name
|
||||
FROM t_oa_enterprise
|
||||
WHERE disabled_flag = #{disabledFlag}
|
||||
AND deleted_flag = #{deletedFlag}
|
||||
<if test="type != null">
|
||||
AND type = #{type}
|
||||
</if>
|
||||
</select>
|
||||
<select id="getDetail"
|
||||
resultType="net.lab1024.sa.admin.module.business.oa.enterprise.domain.vo.EnterpriseVO">
|
||||
SELECT oe.*
|
||||
FROM t_oa_enterprise oe
|
||||
WHERE oe.enterprise_id = #{enterpriseId} AND oe.deleted_flag = #{deletedFlag}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,56 @@
|
||||
<?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="net.lab1024.sa.admin.module.business.oa.invoice.InvoiceDao">
|
||||
<update id="deleteInvoice">
|
||||
UPDATE t_oa_invoice
|
||||
SET deleted_flag = #{deletedFlag}
|
||||
WHERE invoice_id = #{invoiceId}
|
||||
</update>
|
||||
<select id="queryByAccountNumber"
|
||||
resultType="net.lab1024.sa.admin.module.business.oa.invoice.domain.InvoiceEntity">
|
||||
SELECT *
|
||||
FROM t_oa_invoice
|
||||
WHERE enterprise_id = #{enterpriseId}
|
||||
AND account_number = #{accountNumber}
|
||||
AND deleted_flag = #{deletedFlag}
|
||||
<if test="excludeInvoiceId != null">
|
||||
AND invoice_id != #{excludeInvoiceId}
|
||||
</if>
|
||||
</select>
|
||||
<select id="queryPage" resultType="net.lab1024.sa.admin.module.business.oa.invoice.domain.InvoiceVO">
|
||||
SELECT t_oa_invoice.*,
|
||||
t_oa_enterprise.enterprise_name
|
||||
FROM t_oa_invoice
|
||||
LEFT JOIN t_oa_enterprise ON t_oa_invoice.enterprise_id = t_oa_enterprise.enterprise_id
|
||||
<where>
|
||||
t_oa_invoice.deleted_flag = #{queryForm.deletedFlag}
|
||||
<if test="queryForm.keywords != null and queryForm.keywords != ''">
|
||||
AND (INSTR(t_oa_invoice.invoice_heads,#{queryForm.keywords}) OR INSTR(t_oa_invoice.account_number,#{queryForm.keywords}) OR
|
||||
INSTR(t_oa_invoice.create_user_name,#{queryForm.keywords}))
|
||||
</if>
|
||||
<if test="queryForm.startTime != null">
|
||||
AND DATE_FORMAT(t_oa_invoice.create_time, '%Y-%m-%d') >= #{queryForm.startTime}
|
||||
</if>
|
||||
<if test="queryForm.endTime != null">
|
||||
AND DATE_FORMAT(t_oa_invoice.create_time, '%Y-%m-%d') <= #{queryForm.endTime}
|
||||
</if>
|
||||
<if test="queryForm.disabledFlag != null">
|
||||
AND t_oa_invoice.disabled_flag = #{queryForm.disabledFlag}
|
||||
</if>
|
||||
<if test="queryForm.enterpriseId != null">
|
||||
AND t_oa_invoice.enterprise_id = #{queryForm.enterpriseId}
|
||||
</if>
|
||||
</where>
|
||||
<if test="queryForm.sortItemList == null or queryForm.sortItemList.size == 0">
|
||||
ORDER BY t_oa_invoice.create_time DESC
|
||||
</if>
|
||||
</select>
|
||||
<select id="getDetail" resultType="net.lab1024.sa.admin.module.business.oa.invoice.domain.InvoiceVO">
|
||||
SELECT t_oa_invoice.*,
|
||||
t_oa_enterprise.enterprise_name
|
||||
FROM t_oa_invoice
|
||||
LEFT JOIN t_oa_enterprise ON t_oa_invoice.enterprise_id = t_oa_enterprise.enterprise_id
|
||||
WHERE t_oa_invoice.invoice_id = #{invoiceId}
|
||||
AND t_oa_invoice.deleted_flag = #{deletedFlag}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,252 @@
|
||||
<?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="net.lab1024.sa.admin.module.business.oa.notice.dao.NoticeDao">
|
||||
|
||||
<!-- ================================== 可见范围相关 ================================== -->
|
||||
|
||||
<insert id="insertVisibleRange">
|
||||
insert into t_notice_visible_range
|
||||
(notice_id, data_type, data_id)
|
||||
values
|
||||
<foreach collection="visibleRangeFormList" separator="," item="item">
|
||||
( #{noticeId} , #{item.dataType}, #{item.dataId} )
|
||||
</foreach>
|
||||
</insert>
|
||||
<delete id="deleteVisibleRange">
|
||||
delete
|
||||
from t_notice_visible_range
|
||||
where notice_id = #{noticeId}
|
||||
</delete>
|
||||
|
||||
<select id="queryVisibleRange"
|
||||
resultType="net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeVisibleRangeVO">
|
||||
select *
|
||||
from t_notice_visible_range
|
||||
where notice_id = #{noticeId}
|
||||
</select>
|
||||
|
||||
<!-- ================================== 通知公告【主表】相关 ================================== -->
|
||||
<update id="updateDeletedFlag">
|
||||
update t_notice
|
||||
set deleted_flag = true
|
||||
where notice_id = #{noticeId}
|
||||
</update>
|
||||
|
||||
<!-- 后管分页查询资讯 -->
|
||||
<select id="query" resultType="net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeVO">
|
||||
SELECT
|
||||
t_notice.* ,
|
||||
t_notice_type.notice_type_name as noticeTypeName,
|
||||
t_employee.actual_name as createUserName,
|
||||
t_department.name as departmentName
|
||||
FROM t_notice
|
||||
left join t_notice_type on t_notice_type.notice_type_id = t_notice.notice_type_id
|
||||
left join t_employee on t_notice.create_user_id = t_employee.employee_id
|
||||
left join t_department on t_employee.department_id = t_department.department_id
|
||||
<where>
|
||||
<if test="query.noticeTypeId != null">
|
||||
AND t_notice_type.notice_type_id = #{query.noticeTypeId}
|
||||
</if>
|
||||
<if test="query.keywords != null and query.keywords !=''">
|
||||
AND ( INSTR(t_notice.title,#{query.keywords})
|
||||
OR INSTR(t_notice.author,#{query.keywords})
|
||||
OR INSTR(t_notice.source,#{query.keywords})
|
||||
)
|
||||
</if>
|
||||
<if test="query.documentNumber != null and query.documentNumber !=''">
|
||||
AND INSTR(t_notice.document_number, #{query.documentNumber})
|
||||
</if>
|
||||
<if test="query.createUserId != null">
|
||||
AND t_notice.create_user_id = #{createUserId}
|
||||
</if>
|
||||
<if test="query.deletedFlag != null">
|
||||
and t_notice.deleted_flag = #{query.deletedFlag}
|
||||
</if>
|
||||
<if test="query.createTimeBegin != null">
|
||||
AND DATE_FORMAT(t_notice.create_time, '%Y-%m-%d') >= DATE_FORMAT(#{query.createTimeBegin},
|
||||
'%Y-%m-%d')
|
||||
</if>
|
||||
<if test="query.createTimeEnd != null">
|
||||
AND DATE_FORMAT(t_notice.create_time, '%Y-%m-%d') <= DATE_FORMAT(#{query.createTimeEnd}, '%Y-%m-%d')
|
||||
</if>
|
||||
<if test="query.publishTimeBegin != null">
|
||||
AND DATE_FORMAT(t_notice.publish_time, '%Y-%m-%d') >= DATE_FORMAT(#{query.publishTimeBegin},
|
||||
'%Y-%m-%d')
|
||||
</if>
|
||||
<if test="query.publishTimeEnd != null">
|
||||
AND DATE_FORMAT(t_notice.publish_time, '%Y-%m-%d') <= DATE_FORMAT(#{query.publishTimeEnd},
|
||||
'%Y-%m-%d')
|
||||
</if>
|
||||
</where>
|
||||
<if test="query.sortItemList == null or query.sortItemList.size == 0">
|
||||
ORDER BY t_notice.publish_time DESC, t_notice.notice_id DESC
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- ================================== 通知公告【员工查看】相关 ================================== -->
|
||||
<select id="queryEmployeeNotice"
|
||||
resultType="net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeEmployeeVO">
|
||||
select
|
||||
t_notice.*,
|
||||
t_notice_type.notice_type_name,
|
||||
(select count(*) from t_notice_view_record where t_notice_view_record.employee_id = #{requestEmployeeId} and
|
||||
t_notice_view_record.notice_id = t_notice.notice_id) as viewFlag
|
||||
from t_notice
|
||||
left join t_notice_type on t_notice.notice_type_id = t_notice_type.notice_type_id
|
||||
<where>
|
||||
<if test="!administratorFlag">
|
||||
(
|
||||
t_notice.notice_id in
|
||||
(select t_notice_visible_range.notice_id
|
||||
from t_notice_visible_range
|
||||
where
|
||||
( t_notice_visible_range.data_type = #{departmentDataType}
|
||||
<if test="requestEmployeeDepartmentIdList != null and requestEmployeeDepartmentIdList.size > 0">
|
||||
and
|
||||
t_notice_visible_range.data_id
|
||||
in
|
||||
<foreach collection="requestEmployeeDepartmentIdList" open="(" close=")" separator="," item="item">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
)
|
||||
or ( t_notice_visible_range.data_type = #{employeeDataType} and t_notice_visible_range.data_id = #{requestEmployeeId} )
|
||||
)
|
||||
or t_notice.all_visible_flag = true
|
||||
)
|
||||
</if>
|
||||
|
||||
and t_notice.deleted_flag = #{deletedFlag}
|
||||
and t_notice.publish_time < now()
|
||||
<if test="query.noticeTypeId != null">
|
||||
AND t_notice_type.notice_type_id = #{query.noticeTypeId}
|
||||
</if>
|
||||
<if test="query.keywords != null and query.keywords !=''">
|
||||
AND ( INSTR(t_notice.title,#{query.keywords})
|
||||
OR INSTR(t_notice.author,#{query.keywords})
|
||||
OR INSTR(t_notice.document_number,#{query.keywords})
|
||||
OR INSTR(t_notice.source,#{query.keywords})
|
||||
)
|
||||
</if>
|
||||
<if test="query.publishTimeBegin != null">
|
||||
AND DATE_FORMAT(t_notice.publish_time, '%Y-%m-%d') >= DATE_FORMAT(#{query.publishTimeBegin},
|
||||
'%Y-%m-%d')
|
||||
</if>
|
||||
<if test="query.publishTimeEnd != null">
|
||||
AND DATE_FORMAT(t_notice.publish_time, '%Y-%m-%d') <= DATE_FORMAT(#{query.publishTimeEnd},
|
||||
'%Y-%m-%d')
|
||||
</if>
|
||||
<if test="query.notViewFlag">
|
||||
AND viewFlag = 0
|
||||
</if>
|
||||
</where>
|
||||
order by t_notice.publish_time desc
|
||||
</select>
|
||||
<select id="queryEmployeeNotViewNotice"
|
||||
resultType="net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeEmployeeVO">
|
||||
select * from
|
||||
(
|
||||
select
|
||||
t_notice.*,
|
||||
t_notice_type.notice_type_name,
|
||||
(select count(*) from t_notice_view_record where t_notice_view_record.employee_id = #{requestEmployeeId} and
|
||||
t_notice_view_record.notice_id = t_notice.notice_id) as viewFlag
|
||||
from t_notice
|
||||
left join t_notice_type on t_notice.notice_type_id = t_notice_type.notice_type_id
|
||||
<where>
|
||||
<if test="!administratorFlag">
|
||||
t_notice.notice_id in
|
||||
(select t_notice_visible_range.notice_id
|
||||
from t_notice_visible_range
|
||||
where
|
||||
(t_notice_visible_range.data_type = #{departmentDataType}
|
||||
<if test="requestEmployeeDepartmentIdList != null and requestEmployeeDepartmentIdList.size > 0">
|
||||
and
|
||||
t_notice_visible_range.data_id
|
||||
in
|
||||
<foreach collection="requestEmployeeDepartmentIdList" open="(" close=")" separator="," item="item">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
)
|
||||
or ( t_notice_visible_range.data_type = #{employeeDataType} and t_notice_visible_range.data_id =
|
||||
#{requestEmployeeId} )
|
||||
)
|
||||
</if>
|
||||
and t_notice.all_visible_flag = true
|
||||
and t_notice.deleted_flag = #{deletedFlag}
|
||||
and t_notice.publish_time < now()
|
||||
<if test="query.noticeTypeId != null">
|
||||
AND t_notice_type.notice_type_id = #{query.noticeTypeId}
|
||||
</if>
|
||||
<if test="query.keywords != null and query.keywords !=''">
|
||||
AND ( INSTR(t_notice.title,#{query.keywords})
|
||||
OR INSTR(t_notice.author,#{query.keywords})
|
||||
OR INSTR(t_notice.documentNumber,#{query.keywords})
|
||||
OR INSTR(t_notice.source,#{query.keywords})
|
||||
)
|
||||
</if>
|
||||
<if test="query.publishTimeBegin != null">
|
||||
AND DATE_FORMAT(t_notice.publish_time, '%Y-%m-%d') >= DATE_FORMAT(#{query.publishTimeBegin},
|
||||
'%Y-%m-%d')
|
||||
</if>
|
||||
<if test="query.publishTimeEnd != null">
|
||||
AND DATE_FORMAT(t_notice.publish_time, '%Y-%m-%d') <= DATE_FORMAT(#{query.publishTimeEnd},
|
||||
'%Y-%m-%d')
|
||||
</if>
|
||||
</where>
|
||||
) t where viewFlag = 0
|
||||
order by t.publish_time desc
|
||||
</select>
|
||||
<select id="queryNoticeViewRecordList"
|
||||
resultType="net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeViewRecordVO">
|
||||
select t_notice_view_record.*,
|
||||
t_employee.actual_name as employeeName,
|
||||
t_department.name as departmentName
|
||||
from t_notice_view_record
|
||||
left join t_employee on t_employee.employee_id = t_notice_view_record.employee_id
|
||||
left join t_department on t_department.department_id = t_employee.department_id
|
||||
where
|
||||
notice_id = #{queryForm.noticeId}
|
||||
<if test="queryForm.keywords != null and queryForm.keywords !=''">
|
||||
AND (
|
||||
INSTR(t_employee.actual_name,#{queryForm.keywords})
|
||||
OR INSTR(t_notice_view_record.first_ip,#{queryForm.keywords})
|
||||
OR INSTR(t_notice_view_record.first_user_agent,#{queryForm.keywords})
|
||||
OR INSTR(t_notice_view_record.last_ip,#{queryForm.keywords})
|
||||
OR INSTR(t_notice_view_record.last_user_agent,#{queryForm.keywords})
|
||||
)
|
||||
</if>
|
||||
<if test="queryForm.departmentId != null ">
|
||||
and t_department.department_id = #{queryForm.departmentId}
|
||||
</if>
|
||||
order by t_notice_view_record.update_time desc,t_notice_view_record.create_time desc
|
||||
</select>
|
||||
|
||||
<!-- ================================== 通知公告【员工查看记录】相关 ================================== -->
|
||||
<select id="viewRecordCount" resultType="java.lang.Long">
|
||||
select count(*)
|
||||
from t_notice_view_record
|
||||
where notice_id = #{noticeId}
|
||||
and employee_id = #{employeeId}
|
||||
</select>
|
||||
<insert id="insertViewRecord">
|
||||
insert into t_notice_view_record (notice_id, employee_id, first_ip, first_user_agent, page_view_count)
|
||||
values (#{noticeId}, #{employeeId}, #{ip}, #{userAgent}, #{pageViewCount})
|
||||
</insert>
|
||||
<update id="updateViewRecord">
|
||||
update t_notice_view_record
|
||||
set page_view_count = page_view_count + 1,
|
||||
last_ip = #{ip},
|
||||
last_user_agent = #{userAgent}
|
||||
where notice_id = #{noticeId}
|
||||
and employee_id = #{employeeId}
|
||||
</update>
|
||||
<update id="updateViewCount">
|
||||
update t_notice
|
||||
set page_view_count = page_view_count + #{pageViewCountIncrement},
|
||||
user_view_count = user_view_count + #{userViewCountIncrement}
|
||||
where notice_id = #{noticeId}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,25 @@
|
||||
<?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="net.lab1024.sa.admin.module.system.position.dao.PositionDao">
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="queryPage" resultType="net.lab1024.sa.admin.module.system.position.domain.vo.PositionVO">
|
||||
SELECT
|
||||
*
|
||||
FROM t_position
|
||||
<where>
|
||||
deleted_flag = #{queryForm.deletedFlag}
|
||||
<!--关键字查询-->
|
||||
<if test="queryForm.keywords != null and queryForm.keywords != ''">
|
||||
AND INSTR(t_position.position_name,#{queryForm.keywords})
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="queryList" resultType="net.lab1024.sa.admin.module.system.position.domain.vo.PositionVO">
|
||||
SELECT *
|
||||
FROM t_position
|
||||
where deleted_flag = #{deletedFlag}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?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="net.lab1024.sa.admin.module.system.department.dao.DepartmentDao">
|
||||
|
||||
|
||||
<select id="listAll" resultType="net.lab1024.sa.admin.module.system.department.domain.vo.DepartmentVO">
|
||||
SELECT t_department.*,
|
||||
t_employee.actual_name as managerName,
|
||||
parent_department.`name` as parentName
|
||||
FROM t_department
|
||||
left join t_employee on t_department.manager_id = t_employee.employee_id
|
||||
left join t_department parent_department on t_department.parent_id = parent_department.department_id
|
||||
order by sort desc
|
||||
</select>
|
||||
|
||||
<select id="countSubDepartment" resultType="java.lang.Integer">
|
||||
SELECT count(*)
|
||||
FROM t_department
|
||||
WHERE parent_id = #{departmentId}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,200 @@
|
||||
<?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="net.lab1024.sa.admin.module.system.employee.dao.EmployeeDao">
|
||||
|
||||
<select id="queryEmployee" resultType="net.lab1024.sa.admin.module.system.employee.domain.vo.EmployeeVO">
|
||||
SELECT
|
||||
t_employee.*,
|
||||
t_department.name AS departmentName
|
||||
FROM t_employee
|
||||
LEFT JOIN t_department ON t_department.department_id = t_employee.department_id
|
||||
<where>
|
||||
<if test="queryForm.keyword != null and queryForm.keyword != ''">
|
||||
AND (
|
||||
INSTR(t_employee.actual_name,#{queryForm.keyword})
|
||||
OR INSTR(t_employee.phone,#{queryForm.keyword})
|
||||
OR INSTR(t_employee.login_name,#{queryForm.keyword})
|
||||
)
|
||||
</if>
|
||||
<if test="departmentIdList != null and departmentIdList.size > 0">
|
||||
and
|
||||
t_employee.department_id
|
||||
in
|
||||
<foreach collection="departmentIdList" open="(" close=")" separator="," item="item">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="queryForm.disabledFlag != null">
|
||||
AND t_employee.disabled_flag = #{queryForm.disabledFlag}
|
||||
</if>
|
||||
<if test="queryForm.deletedFlag != null">
|
||||
AND t_employee.deleted_flag = #{queryForm.deletedFlag}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<update id="updateDisableFlag">
|
||||
UPDATE t_employee
|
||||
SET disabled_flag = #{disabledFlag}
|
||||
WHERE employee_id = #{employeeId}
|
||||
</update>
|
||||
|
||||
|
||||
<select id="getByLoginName" resultType="net.lab1024.sa.admin.module.system.employee.domain.entity.EmployeeEntity">
|
||||
SELECT *
|
||||
FROM t_employee
|
||||
<where>
|
||||
login_name = #{loginName}
|
||||
<if test="disabledFlag != null">
|
||||
AND disabled_flag = #{disabledFlag}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getByActualName" resultType="net.lab1024.sa.admin.module.system.employee.domain.entity.EmployeeEntity">
|
||||
SELECT *
|
||||
FROM t_employee
|
||||
<where>
|
||||
actual_name = #{actualName}
|
||||
<if test="disabledFlag != null">
|
||||
AND disabled_flag = #{disabledFlag}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getByPhone" resultType="net.lab1024.sa.admin.module.system.employee.domain.entity.EmployeeEntity">
|
||||
SELECT *
|
||||
FROM t_employee
|
||||
<where>
|
||||
phone = #{phone}
|
||||
<if test="disabledFlag != null">
|
||||
AND disabled_flag = #{disabledFlag}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="listAll" resultType="net.lab1024.sa.admin.module.system.employee.domain.vo.EmployeeVO">
|
||||
SELECT *
|
||||
FROM t_employee
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="countByDepartmentId" resultType="integer">
|
||||
SELECT count(1) FROM t_employee
|
||||
WHERE
|
||||
department_id = #{departmentId} AND deleted_flag = #{deletedFlag}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectByDepartmentId"
|
||||
resultType="net.lab1024.sa.admin.module.system.employee.domain.entity.EmployeeEntity">
|
||||
SELECT *
|
||||
FROM t_employee
|
||||
<where>
|
||||
department_id = #{departmentId}
|
||||
<if test="disabledFlag != null">
|
||||
AND disabled_flag = #{disabledFlag}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="selectByActualName"
|
||||
resultType="net.lab1024.sa.admin.module.system.employee.domain.entity.EmployeeEntity">
|
||||
SELECT * FROM t_employee
|
||||
<where>
|
||||
actual_name = #{actualName}
|
||||
AND department_id in
|
||||
<foreach collection="departmentIdList" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
<if test="disabledFlag != null">
|
||||
AND disabled_flag = #{disabledFlag}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getEmployeeIdByDepartmentIdList" resultType="java.lang.Long">
|
||||
SELECT employee_id
|
||||
FROM t_employee
|
||||
<where>
|
||||
department_id IN
|
||||
<foreach collection="departmentIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
<if test="disabledFlag != null">
|
||||
AND disabled_flag = #{disabledFlag}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getEmployeeId" resultType="java.lang.Long">
|
||||
SELECT employee_id
|
||||
FROM t_employee
|
||||
<where>
|
||||
<if test="disabledFlag != null">
|
||||
AND disabled_flag = #{disabledFlag}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getEmployeeIdByDepartmentId" resultType="java.lang.Long">
|
||||
SELECT employee_id
|
||||
FROM t_employee
|
||||
<where>
|
||||
department_id = #{departmentId}
|
||||
<if test="disabledFlag != null">
|
||||
AND disabled_flag = #{disabledFlag}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="getEmployeeByIds" resultType="net.lab1024.sa.admin.module.system.employee.domain.vo.EmployeeVO">
|
||||
SELECT * FROM t_employee
|
||||
where employee_id IN
|
||||
<foreach collection="employeeIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getEmployeeById" resultType="net.lab1024.sa.admin.module.system.employee.domain.vo.EmployeeVO">
|
||||
SELECT t_employee.*,
|
||||
t_department.name AS departmentName
|
||||
FROM t_employee
|
||||
LEFT JOIN t_department ON t_department.department_id = t_employee.department_id
|
||||
where t_employee.employee_id = #{employeeId}
|
||||
</select>
|
||||
|
||||
<select id="selectEmployeeByDisabledAndDeleted"
|
||||
resultType="net.lab1024.sa.admin.module.system.employee.domain.vo.EmployeeVO">
|
||||
SELECT
|
||||
t_employee.*,
|
||||
t_department.name AS departmentName
|
||||
FROM t_employee
|
||||
LEFT JOIN t_department ON t_department.department_id = t_employee.department_id
|
||||
<where>
|
||||
<if test="disabledFlag != null">
|
||||
AND t_employee.disabled_flag = #{disabledFlag}
|
||||
</if>
|
||||
<if test="deletedFlag != null">
|
||||
AND t_employee.deleted_flag = #{deletedFlag}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<update id="updatePassword">
|
||||
UPDATE t_employee
|
||||
SET login_pwd = #{password}
|
||||
WHERE employee_id = #{employeeId}
|
||||
</update>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,78 @@
|
||||
<?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="net.lab1024.sa.admin.module.system.menu.dao.MenuDao">
|
||||
|
||||
<delete id="deleteByMenuIdList">
|
||||
<if test="menuIdList != null and menuIdList.size > 0">
|
||||
<foreach collection="menuIdList" item="item" separator=";">
|
||||
update t_menu
|
||||
set deleted_flag = #{deletedFlag},
|
||||
update_user_id = #{updateUserId}
|
||||
where menu_id = #{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</delete>
|
||||
|
||||
<select id="getByMenuName"
|
||||
resultType="net.lab1024.sa.admin.module.system.menu.domain.entity.MenuEntity">
|
||||
select *
|
||||
from t_menu
|
||||
where menu_name = #{menuName}
|
||||
and parent_id = #{parentId}
|
||||
and deleted_flag = #{deletedFlag} limit 1
|
||||
</select>
|
||||
<select id="queryMenuList" resultType="net.lab1024.sa.admin.module.system.menu.domain.vo.MenuVO">
|
||||
select * from t_menu
|
||||
where deleted_flag = #{deletedFlag}
|
||||
<if test="disabledFlag != null">
|
||||
and disabled_flag = #{disabledFlag}
|
||||
</if>
|
||||
<if test="menuTypeList != null and menuTypeList.size > 0">
|
||||
and menu_type in
|
||||
<foreach collection="menuTypeList" open="(" close=")" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
order by parent_id desc,sort asc
|
||||
</select>
|
||||
<select id="getPointListByMenuId"
|
||||
resultType="net.lab1024.sa.admin.module.system.menu.domain.entity.MenuEntity">
|
||||
select *
|
||||
from t_menu
|
||||
where parent_id = #{menuId}
|
||||
and deleted_flag = #{deletedFlag}
|
||||
and menu_type = #{menuType}
|
||||
</select>
|
||||
|
||||
<select id="queryMenuByEmployeeId"
|
||||
resultType="net.lab1024.sa.admin.module.system.menu.domain.vo.MenuVO">
|
||||
select t_menu.* from t_menu
|
||||
left join t_role_menu on t_role_menu.menu_id = t_menu.menu_id
|
||||
left join t_role_employee on t_role_employee.role_id = t_role_menu.role_id
|
||||
where t_menu.disabled_flag = #{disabledFlag} and t_menu.deleted_flag = #{deletedFlag}
|
||||
<if test="employeeId != null">
|
||||
and t_role_employee.employee_id = #{employeeId}
|
||||
</if>
|
||||
</select>
|
||||
<select id="queryMenuByType" resultType="net.lab1024.sa.admin.module.system.menu.domain.entity.MenuEntity">
|
||||
select *
|
||||
from t_menu
|
||||
where disabled_flag = #{disabledFlag}
|
||||
and deleted_flag = #{deletedFlag}
|
||||
and menu_type = #{menuType}
|
||||
</select>
|
||||
<select id="getByWebPerms" resultType="net.lab1024.sa.admin.module.system.menu.domain.entity.MenuEntity">
|
||||
select *
|
||||
from t_menu
|
||||
where web_perms = #{webPerms}
|
||||
and deleted_flag = #{deletedFlag} limit 1
|
||||
</select>
|
||||
<select id="selectMenuIdByParentIdList" resultType="java.lang.Long">
|
||||
<if test="menuIdList != null and menuIdList.size > 0">
|
||||
select menu_id from t_menu where parent_id in
|
||||
<foreach collection="menuIdList" open="(" close=")" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,24 @@
|
||||
<?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="net.lab1024.sa.admin.module.system.role.dao.RoleDataScopeDao">
|
||||
|
||||
<resultMap id="DataScopeRoleEntity" type="net.lab1024.sa.admin.module.system.role.domain.entity.RoleDataScopeEntity"></resultMap>
|
||||
|
||||
<select id="listByRoleId" resultMap="DataScopeRoleEntity">
|
||||
select id,data_scope_type,view_type,role_id,update_time,create_time from t_role_data_scope where role_id = #{roleId}
|
||||
</select>
|
||||
|
||||
<select id="listByRoleIdList" resultMap="DataScopeRoleEntity">
|
||||
select id,data_scope_type,view_type,role_id,update_time,create_time from t_role_data_scope where role_id IN
|
||||
<foreach collection="roleIdList" item="item" open="(" close= ")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<delete id="deleteByRoleId">
|
||||
DELETE FROM t_role_data_scope
|
||||
WHERE role_id = #{roleId}
|
||||
</delete>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,149 @@
|
||||
<?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="net.lab1024.sa.admin.module.system.role.dao.RoleEmployeeDao">
|
||||
|
||||
|
||||
<resultMap id="EmployeeVO"
|
||||
type="net.lab1024.sa.admin.module.system.employee.domain.vo.EmployeeVO"></resultMap>
|
||||
|
||||
|
||||
<select id="selectRoleByEmployeeId" resultType="net.lab1024.sa.admin.module.system.role.domain.vo.RoleVO">
|
||||
SELECT t_role.*
|
||||
FROM t_role_employee
|
||||
left join t_role on t_role_employee.role_id = t_role.role_id
|
||||
WHERE t_role_employee.employee_id = #{employeeId}
|
||||
</select>
|
||||
|
||||
<select id="selectRoleIdByEmployeeId" resultType="java.lang.Long">
|
||||
SELECT er.role_id
|
||||
FROM t_role_employee er
|
||||
WHERE er.employee_id = #{employeeId}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectRoleEmployeeByName" resultMap="EmployeeVO">
|
||||
SELECT
|
||||
t_employee.employee_id,
|
||||
t_employee.login_name,
|
||||
t_employee.login_pwd,
|
||||
t_employee.actual_name,
|
||||
t_employee.phone,
|
||||
t_employee.department_id,
|
||||
t_employee.disabled_flag,
|
||||
t_employee.remark,
|
||||
t_employee.update_time,
|
||||
t_employee.create_time
|
||||
FROM
|
||||
t_role_employee
|
||||
left join t_employee on t_role_employee.employee_id = t_employee.employee_id
|
||||
left join t_role on t_role_employee.role_id = t_role.role_id
|
||||
<where>
|
||||
<if test="queryForm.keywords != null and queryForm.keywords!= ''">
|
||||
AND (
|
||||
INSTR(t_employee.actual_name,#{queryForm.keywords})
|
||||
OR INSTR(t_employee.phone,#{queryForm.keywords})
|
||||
OR INSTR(t_employee.login_name,#{queryForm.keywords})
|
||||
)
|
||||
</if>
|
||||
<if test="queryForm.roleId != null">
|
||||
AND t_role_employee.role_id = #{queryForm.roleId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectEmployeeByRoleId" resultMap="EmployeeVO">
|
||||
SELECT t_employee.employee_id,
|
||||
t_employee.login_name,
|
||||
t_employee.login_pwd,
|
||||
t_employee.actual_name,
|
||||
t_employee.phone,
|
||||
t_employee.department_id,
|
||||
t_employee.disabled_flag,
|
||||
t_employee.remark,
|
||||
t_employee.update_time,
|
||||
t_employee.create_time
|
||||
FROM t_role_employee
|
||||
left join t_employee on t_role_employee.employee_id = t_employee.employee_id
|
||||
WHERE t_role_employee.role_id = #{roleId}
|
||||
</select>
|
||||
|
||||
<select id="selectEmployeeIdByRoleIdList" resultType="java.lang.Long">
|
||||
SELECT
|
||||
employee_id
|
||||
FROM
|
||||
t_role_employee
|
||||
WHERE
|
||||
role_id in
|
||||
<foreach collection="roleIdList" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
<select id="selectRoleIdByEmployeeIdList"
|
||||
resultType="net.lab1024.sa.admin.module.system.role.domain.entity.RoleEmployeeEntity">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
t_role_employee
|
||||
WHERE
|
||||
employee_id in
|
||||
<foreach collection="employeeIdList" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="selectRoleByEmployeeIdList"
|
||||
resultType="net.lab1024.sa.admin.module.system.role.domain.vo.RoleEmployeeVO">
|
||||
SELECT
|
||||
t_role_employee.role_id,
|
||||
t_role_employee.employee_id,
|
||||
t_role.role_name
|
||||
FROM
|
||||
t_role_employee
|
||||
LEFT JOIN t_role ON t_role.role_id = t_role_employee.role_id
|
||||
WHERE
|
||||
employee_id in
|
||||
<foreach collection="employeeIdList" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
<delete id="deleteByEmployeeId">
|
||||
DELETE
|
||||
FROM t_role_employee
|
||||
WHERE employee_id = #{employeeId}
|
||||
</delete>
|
||||
|
||||
|
||||
<delete id="deleteByRoleId">
|
||||
DELETE
|
||||
FROM t_role_employee
|
||||
WHERE role_id = #{roleId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByEmployeeIdRoleId">
|
||||
DELETE
|
||||
FROM t_role_employee
|
||||
WHERE role_id = #{roleId}
|
||||
and employee_id = #{employeeId}
|
||||
</delete>
|
||||
|
||||
|
||||
<delete id="batchDeleteEmployeeRole">
|
||||
DELETE FROM t_role_employee
|
||||
WHERE role_id = #{roleId} and employee_id in
|
||||
<foreach collection="employeeIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="existsByRoleId" resultType="java.lang.Integer">
|
||||
SELECT 1
|
||||
FROM t_role_employee er
|
||||
WHERE er.role_id = #{roleId}
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,21 @@
|
||||
<?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="net.lab1024.sa.admin.module.system.role.dao.RoleDao">
|
||||
|
||||
<resultMap id="RoleEntity"
|
||||
type="net.lab1024.sa.admin.module.system.role.domain.entity.RoleEntity"></resultMap>
|
||||
|
||||
|
||||
<select id="getByRoleName" resultMap="RoleEntity">
|
||||
SELECT *
|
||||
FROM t_role
|
||||
WHERE role_name = #{roleName}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getByRoleCode" resultMap="RoleEntity">
|
||||
SELECT *
|
||||
FROM t_role
|
||||
WHERE role_code = #{roleCode}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,42 @@
|
||||
<?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="net.lab1024.sa.admin.module.system.role.dao.RoleMenuDao">
|
||||
<delete id="deleteByRoleId">
|
||||
delete
|
||||
from t_role_menu
|
||||
where role_id = #{roleId}
|
||||
</delete>
|
||||
<select id="queryMenuIdByRoleId" resultType="java.lang.Long">
|
||||
select menu_id
|
||||
from t_role_menu
|
||||
where role_id = #{roleId}
|
||||
</select>
|
||||
<select id="queryAllRoleMenu"
|
||||
resultType="net.lab1024.sa.admin.module.system.role.domain.entity.RoleMenuEntity">
|
||||
select *
|
||||
from t_role_menu
|
||||
</select>
|
||||
|
||||
<select id="selectMenuListByRoleIdList"
|
||||
resultType="net.lab1024.sa.admin.module.system.menu.domain.entity.MenuEntity">
|
||||
|
||||
SELECT
|
||||
t_menu.*
|
||||
from t_menu
|
||||
left join t_role_menu on t_role_menu.menu_id = t_menu.menu_id
|
||||
<where>
|
||||
<if test="deletedFlag != null">
|
||||
and t_menu.deleted_flag = #{deletedFlag}
|
||||
</if>
|
||||
<if test="roleIdList != null and roleIdList.size > 0">
|
||||
and t_role_menu.role_id in
|
||||
<foreach collection="roleIdList" open="(" close=")" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
group by t_menu.menu_id
|
||||
ORDER BY t_menu.sort ASC
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user