2023-12-16 20:41:20 +08:00
|
|
|
<?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.bonus.sgzb.base.mapper.WarehouseKeeperMapper">
|
|
|
|
|
<insert id="add">
|
|
|
|
|
insert into ma_type_keeper(type_id, user_id,company_id,time) values
|
|
|
|
|
<foreach item="item" index="index" collection="list" separator=",">
|
|
|
|
|
(#{item.typeIds},#{item.userId},#{item.companyId},NOW())
|
|
|
|
|
</foreach>
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteByIds">
|
|
|
|
|
DELETE FROM ma_type_keeper WHERE `type_id` = #{typeId}
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteByIdsAll">
|
|
|
|
|
delete from ma_type_keeper where type_id in
|
|
|
|
|
<foreach item="typeIds" collection="array" open="(" separator="," close=")">
|
|
|
|
|
#{typeIds}
|
|
|
|
|
</foreach>
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
<select id="getWarehouseKeeperInfoAll" resultType="com.bonus.sgzb.base.domain.WarehouseKeeper">
|
|
|
|
|
SELECT mt.type_id as modelId ,mt.type_name as modelName,
|
2024-04-11 10:40:04 +08:00
|
|
|
mt2.type_name as typeName,
|
|
|
|
|
mt4.type_name as kindName,
|
|
|
|
|
su.user_id as userId, su.nick_name as userName
|
2023-12-16 20:41:20 +08:00
|
|
|
FROM ma_type mt
|
|
|
|
|
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id AND mt2.`level` = '3'
|
|
|
|
|
LEFT JOIN ma_type mt3 ON mt2.parent_id = mt3.type_id AND mt3.`level` = '2'
|
|
|
|
|
LEFT JOIN ma_type mt4 ON mt3.parent_id = mt4.type_id AND mt4.`level` = '1'
|
|
|
|
|
LEFT JOIN ma_type_keeper mtk ON mtk.type_id = mt.type_id
|
|
|
|
|
LEFT JOIN sys_user su ON su.user_id = mtk.user_id
|
|
|
|
|
WHERE mt.`level` = '4' AND mt.`del_flag` = '0'
|
|
|
|
|
<if test="typeName != null and typeName != ''">
|
2024-01-22 21:02:51 +08:00
|
|
|
AND mt2.type_name like concat('%', #{typeName}, '%')
|
2023-12-16 20:41:20 +08:00
|
|
|
</if>
|
2023-12-19 09:58:39 +08:00
|
|
|
ORDER BY mt.type_id DESC
|
2023-12-16 20:41:20 +08:00
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="getMaUserList" resultType="com.bonus.sgzb.base.domain.WarehouseKeeper">
|
2024-03-11 17:35:30 +08:00
|
|
|
SELECT su.user_id as userId, su.nick_name as userName FROM `sys_user` su
|
2023-12-16 20:41:20 +08:00
|
|
|
LEFT JOIN sys_user_role sur ON su.user_id = sur.user_id
|
|
|
|
|
LEFT JOIN sys_role sr ON sr.role_id = sur.role_id
|
2024-05-08 18:23:47 +08:00
|
|
|
WHERE sr.role_id = '132' AND su.del_flag = '0'
|
2023-12-16 20:41:20 +08:00
|
|
|
<if test="userName != null and userName != ''">
|
2024-03-11 17:35:30 +08:00
|
|
|
AND su.nick_name like concat('%', #{userName}, '%')
|
2023-12-16 20:41:20 +08:00
|
|
|
</if>
|
2023-12-19 09:58:39 +08:00
|
|
|
ORDER BY su.user_id DESC
|
2023-12-16 20:41:20 +08:00
|
|
|
</select>
|
|
|
|
|
</mapper>
|