2023-12-16 20:55:40 +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.system.mapper.PurchaseNoticePersonMapper">
|
|
|
|
|
|
|
|
|
|
<resultMap type="com.bonus.sgzb.system.domain.PurchaseNoticePerson" id="PurchaseNoticePersonResult">
|
|
|
|
|
<result property="id" column="id" />
|
|
|
|
|
<result property="userId" column="user_id" />
|
|
|
|
|
<result property="userName" column="user_name" />
|
|
|
|
|
<result property="telphone" column="telphone" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectPurchaseNoticePersonVo">
|
|
|
|
|
select id, user_id, user_name, telphone from purchase_notice_person
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectPurchaseNoticePersonList" parameterType="com.bonus.sgzb.system.domain.PurchaseNoticePerson" resultMap="PurchaseNoticePersonResult">
|
|
|
|
|
select pnp.id, pnp.user_id, pnp.user_name, telphone,r.role_name,concat(d2.dept_name,'/',d1.dept_name,'/',d.dept_name) deptName
|
|
|
|
|
from purchase_notice_person pnp
|
|
|
|
|
left join sys_user u on pnp.user_id = u.user_id
|
|
|
|
|
left join sys_user_role sur on u.user_id = sur.user_id
|
|
|
|
|
left join sys_role r on sur.role_id = r.role_id
|
|
|
|
|
left join sys_dept d on u.dept_id = d.dept_id
|
|
|
|
|
left join sys_dept d1 on d.parent_id = d1.dept_id
|
|
|
|
|
left join sys_dept d2 on d1.parent_id = d2.dept_id
|
2023-12-22 19:14:59 +08:00
|
|
|
where u.status = '0'
|
2023-12-16 20:55:40 +08:00
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectPurchaseNoticePersonById" parameterType="Long" resultMap="PurchaseNoticePersonResult">
|
|
|
|
|
<include refid="selectPurchaseNoticePersonVo"/>
|
|
|
|
|
where id = #{id}
|
|
|
|
|
</select>
|
2023-12-22 19:14:59 +08:00
|
|
|
<select id="getUserByRoleList" resultType="com.bonus.sgzb.system.domain.PurchaseNoticePerson">
|
|
|
|
|
select u.user_id userId, u.dept_id deptId, u.nick_name nickName, u.user_name userName, u.avatar, u.phonenumber telphone,
|
|
|
|
|
concat(d2.dept_name,'/',d1.dept_name,'/',d.dept_name) deptName,r.role_name roleName
|
|
|
|
|
from sys_user u
|
|
|
|
|
left join sys_user_role sur on u.user_id = sur.user_id
|
|
|
|
|
left join sys_role r on sur.role_id = r.role_id
|
|
|
|
|
left join sys_dept d on u.dept_id = d.dept_id
|
|
|
|
|
left join sys_dept d1 on d.parent_id = d1.dept_id
|
|
|
|
|
left join sys_dept d2 on d1.parent_id = d2.dept_id
|
|
|
|
|
where u.status = '0' and u.del_flag = '0' and u.user_id not in (select user_id from purchase_notice_person)
|
|
|
|
|
</select>
|
|
|
|
|
|
2023-12-16 20:55:40 +08:00
|
|
|
<insert id="insertPurchaseNoticePerson" parameterType="com.bonus.sgzb.system.domain.PurchaseNoticePerson">
|
|
|
|
|
insert into purchase_notice_person
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="userId != null">user_id,</if>
|
|
|
|
|
<if test="userName != null">user_name,</if>
|
|
|
|
|
<if test="telphone != null">telphone,</if>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="userId != null">#{userId},</if>
|
|
|
|
|
<if test="userName != null">#{userName},</if>
|
|
|
|
|
<if test="telphone != null">#{telphone},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<update id="updatePurchaseNoticePerson" parameterType="com.bonus.sgzb.system.domain.PurchaseNoticePerson">
|
|
|
|
|
update purchase_notice_person
|
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
|
<if test="userId != null">user_id = #{userId},</if>
|
|
|
|
|
<if test="userName != null">user_name = #{userName},</if>
|
|
|
|
|
<if test="telphone != null">telphone = #{telphone},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
where id = #{id}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<delete id="deletePurchaseNoticePersonById" parameterType="Long">
|
2023-12-22 19:14:59 +08:00
|
|
|
delete from purchase_notice_person where user_id = #{userId}
|
2023-12-16 20:55:40 +08:00
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
<delete id="deletePurchaseNoticePersonByIds" parameterType="String">
|
|
|
|
|
delete from purchase_notice_person where id in
|
|
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
|
#{id}
|
|
|
|
|
</foreach>
|
|
|
|
|
</delete>
|
|
|
|
|
</mapper>
|