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

252 lines
15 KiB
XML

<?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" />
<result property="pqOaRemark" column="pq_oa_remark" />
<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">
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">
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,
a.pq_approval_status,a.pq_oa_approval_status,a.pq_oa_remark,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
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>
<!-- 数据范围过滤 -->
${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">pq_code,</if>
<if test="pqNumber != null">pq_number,</if>
<if test="pqSalesmanCode != null">pq_salesman_code,</if>
<if test="pqSalesmanBm != null">pq_salesman_bm,</if>
<if test="pqSalesmanName != null">pq_salesman_name,</if>
<if test="pqSalesmanDeptId != null">pq_salesman_dept_id,</if>
<if test="pqSalesmanDeptName != null">pq_salesman_dept_name,</if>
<if test="pqCustomerBm != null">pq_customer_bm,</if>
<if test="pqCustomerName != null">pq_customer_name,</if>
<if test="pqProject != null">pq_project,</if>
<if test="pqBidWinningRemark != null">pq_bid_winning_remark,</if>
<if test="pqAuthorizedRepresentative != null">pq_authorized_representative,</if>
<if test="pqBidDate != null">pq_bid_date,</if>
<if test="pqZbr != null">pq_zbr,</if>
<if test="pqBidWinningStatus != null">pq_bid_winning_status,</if>
<if test="pqIllustrate != null">pq_illustrate,</if>
<if test="pqAnnouncementLinkWebsite != null">pq_announcement_link_website,</if>
<if test="pqPhone != null">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>
<if test="pqOaApprovalStatus != null">pq_oa_approval_status,</if>
<if test="pqOaRemark != null">pq_oa_remark,</if>
<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>
<if test="pqCode != null">#{pqCode},</if>
<if test="pqNumber != null">#{pqNumber},</if>
<if test="pqSalesmanCode != null">#{pqSalesmanCode},</if>
<if test="pqSalesmanBm != null">#{pqSalesmanBm},</if>
<if test="pqSalesmanName != null">#{pqSalesmanName},</if>
<if test="pqSalesmanDeptId != null">#{pqSalesmanDeptId},</if>
<if test="pqSalesmanDeptName != null">#{pqSalesmanDeptName},</if>
<if test="pqCustomerBm != null">#{pqCustomerBm},</if>
<if test="pqCustomerName != null">#{pqCustomerName},</if>
<if test="pqProject != null">#{pqProject},</if>
<if test="pqBidWinningRemark != null">#{pqBidWinningRemark},</if>
<if test="pqAuthorizedRepresentative != null">#{pqAuthorizedRepresentative},</if>
<if test="pqBidDate != null">#{pqBidDate},</if>
<if test="pqZbr != null">#{pqZbr},</if>
<if test="pqBidWinningStatus != null">#{pqBidWinningStatus},</if>
<if test="pqIllustrate != null">#{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>
<if test="pqOaApprovalStatus != null">#{pqOaApprovalStatus},</if>
<if test="pqOaRemark != null">#{pqOaRemark},</if>
<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=",">
<if test="userId != null">user_id,</if>
<if test="departmentId != null">department_id,</if>
<if test="submissionTime != null">submission_time,</if>
<if test="pqId != null">pq_id,</if>
<if test="pqCode != null">pq_code,</if>
<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>
<if test="pqZbr != null">pq_zbr,</if>
<if test="pqIllustrate != null">pq_illustrate,</if>
<if test="createTime != null">create_time,</if>
<if test="isFinish != null">isFinish,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null">#{userId},</if>
<if test="departmentId != null">#{departmentId},</if>
<if test="submissionTime != null">#{submissionTime},</if>
<if test="pqId != null">#{pqId},</if>
<if test="pqCode != null">#{pqCode},</if>
<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>
<if test="pqZbr != null">#{pqZbr},</if>
<if test="pqIllustrate != null">#{pqIllustrate},</if>
<if test="createTime != null">#{createTime},</if>
<if test="isFinish != null">#{isFinish},</if>
</trim>
</insert>
<update id="updateZgys" parameterType="Zgys">
update zgys
<trim prefix="SET" suffixOverrides=",">
<if test="pqCode != null">pq_code = #{pqCode},</if>
<if test="pqNumber != null">pq_number = #{pqNumber},</if>
<if test="pqSalesmanCode != null">pq_salesman_code = #{pqSalesmanCode},</if>
<if test="pqSalesmanBm != null">pq_salesman_bm = #{pqSalesmanBm},</if>
<if test="pqSalesmanName != null">pq_salesman_name = #{pqSalesmanName},</if>
<if test="pqSalesmanDeptId != null">pq_salesman_dept_id = #{pqSalesmanDeptId},</if>
<if test="pqSalesmanDeptName != null">pq_salesman_dept_name = #{pqSalesmanDeptName},</if>
<if test="pqCustomerBm != null">pq_customer_bm = #{pqCustomerBm},</if>
<if test="pqCustomerName != null">pq_customer_name = #{pqCustomerName},</if>
<if test="pqProject != null">pq_project = #{pqProject},</if>
<if test="pqBidWinningRemark != null">pq_bid_winning_remark = #{pqBidWinningRemark},</if>
<if test="pqAuthorizedRepresentative != null">pq_authorized_representative = #{pqAuthorizedRepresentative},</if>
<if test="pqBidDate != null">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">pq_illustrate = #{pqIllustrate},</if>
<if test="pqAnnouncementLinkWebsite != null">pq_announcement_link_website = #{pqAnnouncementLinkWebsite},</if>
<if test="pqPhone != null">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>
<if test="pqOaApprovalStatus != null">pq_oa_approval_status = #{pqOaApprovalStatus},</if>
<if test="pqOaRemark != null">pq_oa_remark = #{pqOaRemark},</if>
<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>
<select id="selectOAUserByUserName" resultType="SysOaZgys">
select top 1 id as userId,departmentid as departmentId from HrmResource where loginid = #{loginid}
</select>
</mapper>