JNBusinessTest/ruoyi-system/target/classes/mapper/zgys/ZgysMapper.xml

252 lines
16 KiB
XML
Raw Normal View History

2024-07-24 14:53:01 +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" />
2024-08-01 17:23:46 +08:00
<result property="pqNumber" column="pq_number" />
2024-07-24 14:53:01 +08:00
<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" />
2024-08-01 17:23:46 +08:00
<result property="pqOaApprovalStatus" column="pq_oa_approval_status" />
<result property="pqReturnRemark" column="pq_returnRemark" />
2024-07-24 14:53:01 +08:00
<result property="pqArchiving" column="pq_archiving" />
2024-08-01 17:23:46 +08:00
<result property="pqVpApproval" column="pq_vp_approval" />
2024-07-24 14:53:01 +08:00
<result property="createBy" column="create_by" />
2024-08-01 17:23:46 +08:00
<result property="createName" column="create_name" />
2024-07-24 14:53:01 +08:00
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="pqJoins">
left join sys_user u on u.user_name=a.create_by
left join sys_dept d on u.dept_id = d.dept_id
</sql>
<sql id="selectZgysVo">
2024-08-01 17:23:46 +08:00
select a.pq_id, a.pq_code, a.pq_number, a.pq_salesman_code, a.pq_salesman_bm, a.pq_salesman_name,
2024-07-24 14:53:01 +08:00
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-01 17:23:46 +08:00
a.pq_approval_status,a.pq_oa_approval_status,a.pq_returnRemark, a.pq_archiving, a.pq_vp_approval,
a.create_by, u.nick_name create_name,a.create_time, a.update_by, a.update_time
2024-07-24 14:53:01 +08:00
from zgys a
<include refid="pqJoins"/>
</sql>
<select id="selectZgysList" parameterType="Zgys" resultMap="ZgysResult">
<include refid="selectZgysVo"/>
<where>
<if test="pqCode != null and pqCode != ''"> and pq_code like concat('%', #{pqCode}, '%')</if>
2024-07-26 17:11:36 +08:00
<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>
2024-07-24 14:53:01 +08:00
<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>
2024-07-26 17:11:36 +08:00
<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>
2024-07-24 14:53:01 +08:00
<if test="pqApprovalStatus != null and pqApprovalStatus != ''"> and pq_approval_status = #{pqApprovalStatus}</if>
<!-- 数据范围过滤 -->
${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>
<if test="pqCode != null and pqCode != ''">pq_code,</if>
2024-08-01 17:23:46 +08:00
<if test="pqNumber != null and pqNumber != ''">pq_number,</if>
2024-07-24 14:53:01 +08:00
<if test="pqSalesmanCode != null">pq_salesman_code,</if>
<if test="pqSalesmanBm != null">pq_salesman_bm,</if>
<if test="pqSalesmanName != null and pqSalesmanName != ''">pq_salesman_name,</if>
<if test="pqSalesmanDeptId != null">pq_salesman_dept_id,</if>
<if test="pqSalesmanDeptName != null and pqSalesmanDeptName != ''">pq_salesman_dept_name,</if>
<if test="pqCustomerBm != null">pq_customer_bm,</if>
<if test="pqCustomerName != null and pqCustomerName != ''">pq_customer_name,</if>
<if test="pqProject != null and pqProject != ''">pq_project,</if>
<if test="pqBidWinningRemark != null">pq_bid_winning_remark,</if>
<if test="pqAuthorizedRepresentative != null and pqAuthorizedRepresentative != ''">pq_authorized_representative,</if>
<if test="pqBidDate != null and pqBidDate != ''">pq_bid_date,</if>
<if test="pqZbr != null">pq_zbr,</if>
<if test="pqBidWinningStatus != null">pq_bid_winning_status,</if>
<if test="pqIllustrate != null and pqIllustrate != ''">pq_illustrate,</if>
<if test="pqAnnouncementLinkWebsite != null">pq_announcement_link_website,</if>
<if test="pqPhone != null and pqPhone != ''">pq_phone,</if>
<if test="pqAgency != null">pq_agency,</if>
<if test="pqRemark != null">pq_remark,</if>
<if test="pqApprovalStatus != null">pq_approval_status,</if>
2024-08-01 17:23:46 +08:00
<if test="pqOaApprovalStatus != null">pq_oa_approval_status,</if>
<if test="pqReturnRemark != null">pq_returnRemark,</if>
2024-07-24 14:53:01 +08:00
<if test="pqArchiving != null">pq_archiving,</if>
2024-08-01 17:23:46 +08:00
<if test="pqVpApproval != null">pq_vp_approval,</if>
2024-07-24 14:53:01 +08:00
<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>
<if test="pqCode != null and pqCode != ''">#{pqCode},</if>
2024-08-01 17:23:46 +08:00
<if test="pqNumber != null and pqNumber != ''">#{pqNumber},</if>
2024-07-24 14:53:01 +08:00
<if test="pqSalesmanCode != null">#{pqSalesmanCode},</if>
<if test="pqSalesmanBm != null">#{pqSalesmanBm},</if>
<if test="pqSalesmanName != null and pqSalesmanName != ''">#{pqSalesmanName},</if>
<if test="pqSalesmanDeptId != null">#{pqSalesmanDeptId},</if>
<if test="pqSalesmanDeptName != null and pqSalesmanDeptName != ''">#{pqSalesmanDeptName},</if>
<if test="pqCustomerBm != null">#{pqCustomerBm},</if>
<if test="pqCustomerName != null and pqCustomerName != ''">#{pqCustomerName},</if>
<if test="pqProject != null and pqProject != ''">#{pqProject},</if>
<if test="pqBidWinningRemark != null">#{pqBidWinningRemark},</if>
<if test="pqAuthorizedRepresentative != null and pqAuthorizedRepresentative != ''">#{pqAuthorizedRepresentative},</if>
<if test="pqBidDate != null and pqBidDate != ''">#{pqBidDate},</if>
<if test="pqZbr != null">#{pqZbr},</if>
<if test="pqBidWinningStatus != null">#{pqBidWinningStatus},</if>
<if test="pqIllustrate != null and pqIllustrate != ''">#{pqIllustrate},</if>
<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>
2024-08-01 17:23:46 +08:00
<if test="pqOaApprovalStatus != null">#{pqOaApprovalStatus},</if>
<if test="pqReturnRemark != null">#{pqReturnRemark},</if>
2024-07-24 14:53:01 +08:00
<if test="pqArchiving != null">#{pqArchiving},</if>
2024-08-01 17:23:46 +08:00
<if test="pqVpApproval != null">#{pqVpApproval},</if>
2024-07-24 14:53:01 +08:00
<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>
2024-08-01 17:23:46 +08:00
<insert id="insertSysOAZgys" parameterType="SysOaZgys">
insert into sys_oa_zgys
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null and userId != ''">user_id,</if>
<if test="departmentId != null and departmentId != ''">department_id,</if>
<if test="submissionTime != null and submissionTime != ''">submission_time,</if>
<if test="pqId != null">pq_id,</if>
<if test="pqCode != null and pqCode != ''">pq_code,</if>
<if test="pqNumber != null and pqNumber != ''">pq_number,</if>
<if test="pqSalesmanName != null and pqSalesmanName != ''">pq_salesman_name,</if>
<if test="pqCustomerName != null and pqCustomerName != ''">pq_customer_name,</if>
<if test="pqProject != null and pqProject != ''">pq_project,</if>
<if test="pqBidWinningRemark != null">pq_bid_winning_remark,</if>
<if test="pqAuthorizedRepresentative != null and pqAuthorizedRepresentative != ''">pq_authorized_representative,</if>
<if test="pqBidDate != null and pqBidDate != ''">pq_bid_date,</if>
<if test="pqZbr != null">pq_zbr,</if>
<if test="pqBidWinningStatus != null">pq_bid_winning_status,</if>
<if test="pqIllustrate != null and pqIllustrate != ''">pq_illustrate,</if>
<if test="createTime != null">create_time,</if>
<if test="pqYwyFile != null and pqYwyFile != ''">pq_ywy_file,</if>
<if test="isFinish != null and isFinish != ''">isFinish,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null and userId != ''">#{userId},</if>
<if test="departmentId != null and departmentId != ''">#{departmentId},</if>
<if test="submissionTime != null and submissionTime != ''">#{submissionTime},</if>
<if test="pqId != null">#{pqId},</if>
<if test="pqCode != null and pqCode != ''">#{pqCode},</if>
<if test="pqNumber != null and pqNumber != ''">#{pqNumber},</if>
<if test="pqSalesmanName != null and pqSalesmanName != ''">#{pqSalesmanName},</if>
<if test="pqCustomerName != null and pqCustomerName != ''">#{pqCustomerName},</if>
<if test="pqProject != null and pqProject != ''">#{pqProject},</if>
<if test="pqBidWinningRemark != null">#{pqBidWinningRemark},</if>
<if test="pqAuthorizedRepresentative != null and pqAuthorizedRepresentative != ''">#{pqAuthorizedRepresentative},</if>
<if test="pqBidDate != null and pqBidDate != ''">#{pqBidDate},</if>
<if test="pqZbr != null">#{pqZbr},</if>
<if test="pqBidWinningStatus != null">#{pqBidWinningStatus},</if>
<if test="pqIllustrate != null and pqIllustrate != ''">#{pqIllustrate},</if>
<if test="createTime != null">#{createTime},</if>
<if test="pqYwyFile != null and pqYwyFile != ''">#{pqYwyFile},</if>
<if test="isFinish != null and isFinish != ''">#{isFinish},</if>
</trim>
</insert>
2024-07-24 14:53:01 +08:00
<update id="updateZgys" parameterType="Zgys">
update zgys
<trim prefix="SET" suffixOverrides=",">
<if test="pqCode != null and pqCode != ''">pq_code = #{pqCode},</if>
2024-08-01 17:23:46 +08:00
<if test="pqNumber != null and pqNumber != ''">pq_number = #{pqNumber},</if>
2024-07-24 14:53:01 +08:00
<if test="pqSalesmanCode != null">pq_salesman_code = #{pqSalesmanCode},</if>
<if test="pqSalesmanBm != null">pq_salesman_bm = #{pqSalesmanBm},</if>
<if test="pqSalesmanName != null and pqSalesmanName != ''">pq_salesman_name = #{pqSalesmanName},</if>
<if test="pqSalesmanDeptId != null">pq_salesman_dept_id = #{pqSalesmanDeptId},</if>
<if test="pqSalesmanDeptName != null and pqSalesmanDeptName != ''">pq_salesman_dept_name = #{pqSalesmanDeptName},</if>
<if test="pqCustomerBm != null">pq_customer_bm = #{pqCustomerBm},</if>
<if test="pqCustomerName != null and pqCustomerName != ''">pq_customer_name = #{pqCustomerName},</if>
<if test="pqProject != null and pqProject != ''">pq_project = #{pqProject},</if>
<if test="pqBidWinningRemark != null">pq_bid_winning_remark = #{pqBidWinningRemark},</if>
<if test="pqAuthorizedRepresentative != null and pqAuthorizedRepresentative != ''">pq_authorized_representative = #{pqAuthorizedRepresentative},</if>
<if test="pqBidDate != null and pqBidDate != ''">pq_bid_date = #{pqBidDate},</if>
<if test="pqZbr != null">pq_zbr = #{pqZbr},</if>
<if test="pqBidWinningStatus != null">pq_bid_winning_status = #{pqBidWinningStatus},</if>
<if test="pqIllustrate != null and pqIllustrate != ''">pq_illustrate = #{pqIllustrate},</if>
<if test="pqAnnouncementLinkWebsite != null">pq_announcement_link_website = #{pqAnnouncementLinkWebsite},</if>
<if test="pqPhone != null and pqPhone != ''">pq_phone = #{pqPhone},</if>
<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>
2024-08-01 17:23:46 +08:00
<if test="pqOaApprovalStatus != null">pq_oa_approval_status = #{pqOaApprovalStatus},</if>
<if test="pqReturnRemark != null">pq_returnRemark = #{pqReturnRemark},</if>
2024-07-24 14:53:01 +08:00
<if test="pqArchiving != null">pq_archiving = #{pqArchiving},</if>
2024-08-01 17:23:46 +08:00
<if test="pqVpApproval != null">pq_vp_approval = #{pqVpApproval},</if>
2024-07-24 14:53:01 +08:00
<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>
2024-08-01 17:23:46 +08:00
<select id="getCodePQ" resultType="String" statementType="CALLABLE">
{call GetSerialNo_Business(#{type,mode=IN,jdbcType=VARCHAR})}
</select>
<select id="selectOAUserByUserName" resultType="SysOaAuthorize">
select top 1 id as userId,departmentid as departmentId from HrmResource where loginid = #{loginid}
</select>
2024-07-24 14:53:01 +08:00
</mapper>