2024-08-05 17:16:54 +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.ruoyi.zgys.mapper.ZgysMapper" >
<resultMap type= "Zgys" id= "ZgysResult" >
<result property= "pqId" column= "pq_id" />
<result property= "pqCode" column= "pq_code" />
<result property= "pqNumber" column= "pq_number" />
<result property= "pqSalesmanCode" column= "pq_salesman_code" />
<result property= "pqSalesmanBm" column= "pq_salesman_bm" />
<result property= "pqSalesmanName" column= "pq_salesman_name" />
<result property= "pqSalesmanDeptId" column= "pq_salesman_dept_id" />
<result property= "pqSalesmanDeptName" column= "pq_salesman_dept_name" />
<result property= "pqCustomerBm" column= "pq_customer_bm" />
<result property= "pqCustomerName" column= "pq_customer_name" />
<result property= "pqProject" column= "pq_project" />
<result property= "pqBidWinningRemark" column= "pq_bid_winning_remark" />
<result property= "pqAuthorizedRepresentative" column= "pq_authorized_representative" />
<result property= "pqBidDate" column= "pq_bid_date" />
<result property= "pqZbr" column= "pq_zbr" />
<result property= "pqBidWinningStatus" column= "pq_bid_winning_status" />
<result property= "pqIllustrate" column= "pq_illustrate" />
<result property= "pqAnnouncementLinkWebsite" column= "pq_announcement_link_website" />
<result property= "pqPhone" column= "pq_phone" />
<result property= "pqAgency" column= "pq_agency" />
<result property= "pqRemark" column= "pq_remark" />
<result property= "pqApprovalStatus" column= "pq_approval_status" />
<result property= "pqOaApprovalStatus" column= "pq_oa_approval_status" />
2024-08-08 15:09:48 +08:00
<result property= "pqOaRemark" column= "pq_oa_remark" />
2024-08-05 17:16:54 +08:00
<result property= "pqReturnRemark" column= "pq_returnRemark" />
<result property= "pqArchiving" column= "pq_archiving" />
<result property= "pqVpApproval" column= "pq_vp_approval" />
<result property= "createBy" column= "create_by" />
<result property= "createName" column= "create_name" />
<result property= "createTime" column= "create_time" />
<result property= "updateBy" column= "update_by" />
<result property= "updateTime" column= "update_time" />
</resultMap>
<sql id= "pqJoins" >
2024-08-09 14:31:55 +08:00
left join sys_user u on u.user_id=a.create_by
2024-08-05 17:16:54 +08:00
left join sys_dept d on u.dept_id = d.dept_id
</sql>
<sql id= "selectZgysVo" >
select a.pq_id, a.pq_code, a.pq_number, a.pq_salesman_code, a.pq_salesman_bm, a.pq_salesman_name,
a.pq_salesman_dept_id, a.pq_salesman_dept_name, a.pq_customer_bm,
a.pq_customer_name, a.pq_project, a.pq_bid_winning_remark, a.pq_authorized_representative,
a.pq_bid_date, a.pq_zbr, a.pq_bid_winning_status, a.pq_illustrate,
a.pq_announcement_link_website, a.pq_phone, a.pq_agency, a.pq_remark,
2024-08-08 15:09:48 +08:00
a.pq_approval_status,a.pq_oa_approval_status,a.pq_oa_remark,a.pq_returnRemark, a.pq_archiving, a.pq_vp_approval,
2024-08-05 17:16:54 +08:00
a.create_by, u.nick_name create_name,a.create_time, a.update_by, a.update_time
from zgys a
<include refid= "pqJoins" />
</sql>
<select id= "selectZgysList" parameterType= "Zgys" resultMap= "ZgysResult" >
<include refid= "selectZgysVo" />
<where >
<if test= "pqNumber != null and pqNumber != ''" > and pq_number like concat('%', #{pqNumber}, '%')</if>
<if test= "pqIllustrate != null and pqIllustrate != ''" > and pq_illustrate = #{pqIllustrate}</if>
<if test= "pqSalesmanName != null and pqSalesmanName != ''" > and u.nick_name like concat('%', #{pqSalesmanName}, '%')</if>
<if test= "pqAuthorizedRepresentative != null and pqAuthorizedRepresentative != ''" > and pq_authorized_representative like concat('%', #{pqAuthorizedRepresentative}, '%')</if>
<if test= "pqCustomerName != null and pqCustomerName != ''" > and pq_customer_name like concat('%', #{pqCustomerName}, '%')</if>
<if test= "pqProject != null and pqProject != ''" > and pq_project like concat('%', #{pqProject}, '%')</if>
<if test= "params.beginPqOpeningDate != null and params.beginPqOpeningDate != '' and params.endPqOpeningDate != null and params.endPqOpeningDate != ''" > and pq_bid_date between #{params.beginPqOpeningDate} and #{params.endPqOpeningDate}</if>
<if test= "pqZbr != null and pqZbr != ''" > and pq_zbr like concat('%', #{pqZbr}, '%')</if>
<if test= "pqApprovalStatus != null and pqApprovalStatus != ''" > and pq_approval_status = #{pqApprovalStatus}</if>
2024-08-12 17:22:13 +08:00
<if test= "createBy != null and createBy != ''" > and a.create_by = #{createBy}</if>
2024-08-05 17:16:54 +08:00
<!-- 数据范围过滤 -->
${params.dataScope}
</where>
</select>
<select id= "selectZgysByPqId" parameterType= "String" resultMap= "ZgysResult" >
<include refid= "selectZgysVo" />
where pq_id = #{pqId}
</select>
<insert id= "insertZgys" parameterType= "Zgys" >
insert into zgys
<trim prefix= "(" suffix= ")" suffixOverrides= "," >
<if test= "pqId != null" > pq_id,</if>
2024-08-08 15:09:48 +08:00
<if test= "pqCode != null" > pq_code,</if>
<if test= "pqNumber != null" > pq_number,</if>
2024-08-05 17:16:54 +08:00
<if test= "pqSalesmanCode != null" > pq_salesman_code,</if>
<if test= "pqSalesmanBm != null" > pq_salesman_bm,</if>
2024-08-08 15:09:48 +08:00
<if test= "pqSalesmanName != null" > pq_salesman_name,</if>
2024-08-05 17:16:54 +08:00
<if test= "pqSalesmanDeptId != null" > pq_salesman_dept_id,</if>
2024-08-08 15:09:48 +08:00
<if test= "pqSalesmanDeptName != null" > pq_salesman_dept_name,</if>
2024-08-05 17:16:54 +08:00
<if test= "pqCustomerBm != null" > pq_customer_bm,</if>
2024-08-08 15:09:48 +08:00
<if test= "pqCustomerName != null" > pq_customer_name,</if>
<if test= "pqProject != null" > pq_project,</if>
2024-08-05 17:16:54 +08:00
<if test= "pqBidWinningRemark != null" > pq_bid_winning_remark,</if>
2024-08-08 15:09:48 +08:00
<if test= "pqAuthorizedRepresentative != null" > pq_authorized_representative,</if>
<if test= "pqBidDate != null" > pq_bid_date,</if>
2024-08-05 17:16:54 +08:00
<if test= "pqZbr != null" > pq_zbr,</if>
<if test= "pqBidWinningStatus != null" > pq_bid_winning_status,</if>
2024-08-08 15:09:48 +08:00
<if test= "pqIllustrate != null" > pq_illustrate,</if>
2024-08-05 17:16:54 +08:00
<if test= "pqAnnouncementLinkWebsite != null" > pq_announcement_link_website,</if>
2024-08-08 15:09:48 +08:00
<if test= "pqPhone != null" > pq_phone,</if>
2024-08-05 17:16:54 +08:00
<if test= "pqAgency != null" > pq_agency,</if>
<if test= "pqRemark != null" > pq_remark,</if>
<if test= "pqApprovalStatus != null" > pq_approval_status,</if>
<if test= "pqOaApprovalStatus != null" > pq_oa_approval_status,</if>
2024-08-08 15:09:48 +08:00
<if test= "pqOaRemark != null" > pq_oa_remark,</if>
2024-08-05 17:16:54 +08:00
<if test= "pqReturnRemark != null" > pq_returnRemark,</if>
<if test= "pqArchiving != null" > pq_archiving,</if>
<if test= "pqVpApproval != null" > pq_vp_approval,</if>
<if test= "createBy != null" > create_by,</if>
<if test= "createTime != null" > create_time,</if>
<if test= "updateBy != null" > update_by,</if>
<if test= "updateTime != null" > update_time,</if>
</trim>
<trim prefix= "values (" suffix= ")" suffixOverrides= "," >
<if test= "pqId != null" > #{pqId},</if>
2024-08-08 15:09:48 +08:00
<if test= "pqCode != null" > #{pqCode},</if>
<if test= "pqNumber != null" > #{pqNumber},</if>
2024-08-05 17:16:54 +08:00
<if test= "pqSalesmanCode != null" > #{pqSalesmanCode},</if>
<if test= "pqSalesmanBm != null" > #{pqSalesmanBm},</if>
2024-08-08 15:09:48 +08:00
<if test= "pqSalesmanName != null" > #{pqSalesmanName},</if>
2024-08-05 17:16:54 +08:00
<if test= "pqSalesmanDeptId != null" > #{pqSalesmanDeptId},</if>
2024-08-08 15:09:48 +08:00
<if test= "pqSalesmanDeptName != null" > #{pqSalesmanDeptName},</if>
2024-08-05 17:16:54 +08:00
<if test= "pqCustomerBm != null" > #{pqCustomerBm},</if>
2024-08-08 15:09:48 +08:00
<if test= "pqCustomerName != null" > #{pqCustomerName},</if>
<if test= "pqProject != null" > #{pqProject},</if>
2024-08-05 17:16:54 +08:00
<if test= "pqBidWinningRemark != null" > #{pqBidWinningRemark},</if>
2024-08-08 15:09:48 +08:00
<if test= "pqAuthorizedRepresentative != null" > #{pqAuthorizedRepresentative},</if>
<if test= "pqBidDate != null" > #{pqBidDate},</if>
2024-08-05 17:16:54 +08:00
<if test= "pqZbr != null" > #{pqZbr},</if>
<if test= "pqBidWinningStatus != null" > #{pqBidWinningStatus},</if>
2024-08-08 15:09:48 +08:00
<if test= "pqIllustrate != null" > #{pqIllustrate},</if>
2024-08-05 17:16:54 +08:00
<if test= "pqAnnouncementLinkWebsite != null" > #{pqAnnouncementLinkWebsite},</if>
<if test= "pqPhone != null and pqPhone != ''" > #{pqPhone},</if>
<if test= "pqAgency != null" > #{pqAgency},</if>
<if test= "pqRemark != null" > #{pqRemark},</if>
<if test= "pqApprovalStatus != null" > #{pqApprovalStatus},</if>
<if test= "pqOaApprovalStatus != null" > #{pqOaApprovalStatus},</if>
2024-08-08 15:09:48 +08:00
<if test= "pqOaRemark != null" > #{pqOaRemark},</if>
2024-08-05 17:16:54 +08:00
<if test= "pqReturnRemark != null" > #{pqReturnRemark},</if>
<if test= "pqArchiving != null" > #{pqArchiving},</if>
<if test= "pqVpApproval != null" > #{pqVpApproval},</if>
<if test= "createBy != null" > #{createBy},</if>
<if test= "createTime != null" > #{createTime},</if>
<if test= "updateBy != null" > #{updateBy},</if>
<if test= "updateTime != null" > #{updateTime},</if>
</trim>
</insert>
<insert id= "insertSysOAZgys" parameterType= "SysOaZgys" >
insert into sys_oa_zgys
<trim prefix= "(" suffix= ")" suffixOverrides= "," >
2024-08-08 15:09:48 +08:00
<if test= "userId != null" > user_id,</if>
<if test= "departmentId != null" > department_id,</if>
<if test= "submissionTime != null" > submission_time,</if>
2024-08-05 17:16:54 +08:00
<if test= "pqId != null" > pq_id,</if>
2024-08-08 16:51:48 +08:00
<if test= "pqCode != null" > pq_code,</if>
2024-08-08 15:09:48 +08:00
<if test= "pqNumber != null" > pq_number,</if>
<if test= "pqSalesmanName != null" > pq_salesman_name,</if>
<if test= "pqCustomerName != null" > pq_customer_name,</if>
<if test= "pqProject != null" > pq_project,</if>
<if test= "pqAuthorizedRepresentative != null" > pq_authorized_representative,</if>
<if test= "pqAgency != null" > pq_agency,</if>
<if test= "pqBidDate != null" > pq_bid_date,</if>
2024-08-05 17:16:54 +08:00
<if test= "pqZbr != null" > pq_zbr,</if>
2024-08-08 15:09:48 +08:00
<if test= "pqIllustrate != null" > pq_illustrate,</if>
2024-08-05 17:16:54 +08:00
<if test= "createTime != null" > create_time,</if>
2024-08-08 15:09:48 +08:00
<if test= "isFinish != null" > isFinish,</if>
2024-08-05 17:16:54 +08:00
</trim>
<trim prefix= "values (" suffix= ")" suffixOverrides= "," >
2024-08-08 15:09:48 +08:00
<if test= "userId != null" > #{userId},</if>
<if test= "departmentId != null" > #{departmentId},</if>
<if test= "submissionTime != null" > #{submissionTime},</if>
2024-08-05 17:16:54 +08:00
<if test= "pqId != null" > #{pqId},</if>
2024-08-08 16:51:48 +08:00
<if test= "pqCode != null" > #{pqCode},</if>
2024-08-08 15:09:48 +08:00
<if test= "pqNumber != null" > #{pqNumber},</if>
<if test= "pqSalesmanName != null" > #{pqSalesmanName},</if>
<if test= "pqCustomerName != null" > #{pqCustomerName},</if>
<if test= "pqProject != null" > #{pqProject},</if>
<if test= "pqAuthorizedRepresentative != null" > #{pqAuthorizedRepresentative},</if>
<if test= "pqAgency != null" > #{pqAgency},</if>
<if test= "pqBidDate != null" > #{pqBidDate},</if>
2024-08-05 17:16:54 +08:00
<if test= "pqZbr != null" > #{pqZbr},</if>
2024-08-08 15:09:48 +08:00
<if test= "pqIllustrate != null" > #{pqIllustrate},</if>
2024-08-05 17:16:54 +08:00
<if test= "createTime != null" > #{createTime},</if>
2024-08-08 15:09:48 +08:00
<if test= "isFinish != null" > #{isFinish},</if>
2024-08-05 17:16:54 +08:00
</trim>
</insert>
<update id= "updateZgys" parameterType= "Zgys" >
update zgys
<trim prefix= "SET" suffixOverrides= "," >
2024-08-08 15:09:48 +08:00
<if test= "pqCode != null" > pq_code = #{pqCode},</if>
<if test= "pqNumber != null" > pq_number = #{pqNumber},</if>
2024-08-05 17:16:54 +08:00
<if test= "pqSalesmanCode != null" > pq_salesman_code = #{pqSalesmanCode},</if>
<if test= "pqSalesmanBm != null" > pq_salesman_bm = #{pqSalesmanBm},</if>
2024-08-08 15:09:48 +08:00
<if test= "pqSalesmanName != null" > pq_salesman_name = #{pqSalesmanName},</if>
2024-08-05 17:16:54 +08:00
<if test= "pqSalesmanDeptId != null" > pq_salesman_dept_id = #{pqSalesmanDeptId},</if>
2024-08-08 15:09:48 +08:00
<if test= "pqSalesmanDeptName != null" > pq_salesman_dept_name = #{pqSalesmanDeptName},</if>
2024-08-05 17:16:54 +08:00
<if test= "pqCustomerBm != null" > pq_customer_bm = #{pqCustomerBm},</if>
2024-08-08 15:09:48 +08:00
<if test= "pqCustomerName != null" > pq_customer_name = #{pqCustomerName},</if>
<if test= "pqProject != null" > pq_project = #{pqProject},</if>
2024-08-05 17:16:54 +08:00
<if test= "pqBidWinningRemark != null" > pq_bid_winning_remark = #{pqBidWinningRemark},</if>
2024-08-08 15:09:48 +08:00
<if test= "pqAuthorizedRepresentative != null" > pq_authorized_representative = #{pqAuthorizedRepresentative},</if>
<if test= "pqBidDate != null" > pq_bid_date = #{pqBidDate},</if>
2024-08-05 17:16:54 +08:00
<if test= "pqZbr != null" > pq_zbr = #{pqZbr},</if>
<if test= "pqBidWinningStatus != null" > pq_bid_winning_status = #{pqBidWinningStatus},</if>
2024-08-08 15:09:48 +08:00
<if test= "pqIllustrate != null" > pq_illustrate = #{pqIllustrate},</if>
2024-08-05 17:16:54 +08:00
<if test= "pqAnnouncementLinkWebsite != null" > pq_announcement_link_website = #{pqAnnouncementLinkWebsite},</if>
2024-08-08 15:09:48 +08:00
<if test= "pqPhone != null" > pq_phone = #{pqPhone},</if>
2024-08-05 17:16:54 +08:00
<if test= "pqAgency != null" > pq_agency = #{pqAgency},</if>
<if test= "pqRemark != null" > pq_remark = #{pqRemark},</if>
<if test= "pqApprovalStatus != null" > pq_approval_status = #{pqApprovalStatus},</if>
<if test= "pqOaApprovalStatus != null" > pq_oa_approval_status = #{pqOaApprovalStatus},</if>
2024-08-08 15:09:48 +08:00
<if test= "pqOaRemark != null" > pq_oa_remark = #{pqOaRemark},</if>
2024-08-05 17:16:54 +08:00
<if test= "pqReturnRemark != null" > pq_returnRemark = #{pqReturnRemark},</if>
<if test= "pqArchiving != null" > pq_archiving = #{pqArchiving},</if>
<if test= "pqVpApproval != null" > pq_vp_approval = #{pqVpApproval},</if>
<if test= "createBy != null" > create_by = #{createBy},</if>
<if test= "createTime != null" > create_time = #{createTime},</if>
<if test= "updateBy != null" > update_by = #{updateBy},</if>
<if test= "updateTime != null" > update_time = #{updateTime},</if>
</trim>
where pq_id = #{pqId}
</update>
<delete id= "deleteZgysByPqId" parameterType= "String" >
delete from zgys where pq_id = #{pqId}
</delete>
<delete id= "deleteZgysByPqIds" parameterType= "String" >
delete from zgys where pq_id in
<foreach item= "pqId" collection= "array" open= "(" separator= "," close= ")" >
#{pqId}
</foreach>
</delete>
<select id= "getCode" resultType= "String" statementType= "CALLABLE" >
{call GetSerialNo(#{type,mode=IN,jdbcType=VARCHAR})}
</select>
<select id= "getCodePQ" resultType= "String" statementType= "CALLABLE" >
{call GetSerialNo_Business(#{type,mode=IN,jdbcType=VARCHAR})}
</select>
2024-08-08 15:09:48 +08:00
<select id= "selectOAUserByUserName" resultType= "SysOaZgys" >
2024-08-05 17:16:54 +08:00
select top 1 id as userId,departmentid as departmentId from HrmResource where loginid = #{loginid}
</select>
</mapper>