185 lines
12 KiB
XML
185 lines
12 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="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="pqArchiving" column="pq_archiving" />
|
|
<result property="pqEmpower" column="pq_empower" />
|
|
<result property="createBy" column="create_by" />
|
|
<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_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_archiving, a.pq_empower, a.create_by, 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="pqCode != null and pqCode != ''"> and pq_code like concat('%', #{pqCode}, '%')</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 and pqCode != ''">pq_code,</if>
|
|
<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>
|
|
<if test="pqArchiving != null">pq_archiving,</if>
|
|
<if test="pqEmpower != null">pq_empower,</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 and pqCode != ''">#{pqCode},</if>
|
|
<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>
|
|
<if test="pqArchiving != null">#{pqArchiving},</if>
|
|
<if test="pqEmpower != null">#{pqEmpower},</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>
|
|
|
|
<update id="updateZgys" parameterType="Zgys">
|
|
update zgys
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="pqCode != null and pqCode != ''">pq_code = #{pqCode},</if>
|
|
<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>
|
|
<if test="pqArchiving != null">pq_archiving = #{pqArchiving},</if>
|
|
<if test="pqEmpower != null">pq_empower = #{pqEmpower},</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>
|
|
</mapper>
|