JNBusinessTest/ruoyi-system/target/classes/mapper/priceVerification/BidHjMapper.xml

135 lines
7.3 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.priceVerification.mapper.BidHjMapper">
<resultMap type="BidHj" id="BidHjResult">
<result property="bidHjId" column="bid_hj_id" />
<result property="bidHjCode" column="bid_hj_code" />
<result property="bidHjPricingType" column="bid_hj_pricing_type" />
<result property="bidHjPricingDate" column="bid_hj_pricing_date" />
<result property="bidHjRemark" column="bid_hj_remark" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="createName" column="create_name" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="bidId" column="bid_id" />
<result property="bidCode" column="bid_code" />
<result property="bidHjApprovalStatus" column="bid_hj_approval_status" />
<result property="bidSalesmanName" column="bid_salesman_name" />
<result property="bidTenderingUnit" column="bid_tendering_unit" />
<result property="bidProject" column="bid_project" />
<result property="bidJsxzConfirmId" column="bid_jsxz_confirm_id" />
<result property="bidJsxzGroupValues" column="bid_jsxz_group_values" />
<result property="bidJsqrTlApprovalStatus" column="bid_jsqr_tl_approval_status" />
<result property="bidJsqrTlRemark" column="bid_jsqr_tl_remark" />
<result property="bidJsqrDyApprovalStatus" column="bid_jsqr_dy_approval_status" />
<result property="bidJsqrDyRemark" column="bid_jsqr_dy_remark" />
<result property="bidJsqrZyApprovalStatus" column="bid_jsqr_zy_approval_status" />
<result property="bidJsqrZyRemark" column="bid_jsqr_zy_remark" />
<result property="bidJsqrQtApprovalStatus" column="bid_jsqr_qt_approval_status" />
<result property="bidJsqrQtRemark" column="bid_jsqr_qt_remark" />
</resultMap>
<sql id="bidHjJoins">
left join sys_user u on u.user_name=a.create_by
left join sys_dept d on u.dept_id = d.dept_id
left join bid q on q.bid_hj_id = a.bid_hj_id
left join bid_jsqr j on j.bid_jsqr_id = q.bid_jsxz_confirm_id
</sql>
<sql id="selectBidHjVo">
select a.bid_hj_id, a.bid_hj_code, a.bid_hj_pricing_type, a.bid_hj_pricing_date, a.bid_hj_remark,
a.create_by, a.create_time, a.update_by, a.update_time,
u.nick_name create_name,
q.bid_hj_approval_status,q.bid_id,q.bid_code,q.bid_salesman_name,
q.bid_tendering_unit,q.bid_project,
q.bid_jsxz_confirm_id,q.bid_jsxz_group_values,
j.bid_jsqr_tl_approval_status,j.bid_jsqr_tl_remark,
j.bid_jsqr_dy_approval_status,j.bid_jsqr_dy_remark,
j.bid_jsqr_zy_approval_status,j.bid_jsqr_zy_remark,
j.bid_jsqr_qt_approval_status,j.bid_jsqr_qt_remark
from bid_hj a
<include refid="bidHjJoins"/>
</sql>
<select id="selectBidHjList" parameterType="BidHj" resultMap="BidHjResult">
<include refid="selectBidHjVo"/>
<where>
<if test="bidHjCode != null and bidHjCode != ''"> and bid_hj_code like concat('%', #{bidHjCode}, '%')</if>
<if test="params.beginBidHjPricingDate != null and params.beginBidHjPricingDate != '' and params.endBidHjPricingDate != null and params.endBidHjPricingDate != ''"> and bid_hj_pricing_date between #{params.beginBidHjPricingDate} and #{params.endBidHjPricingDate}</if>
<if test="bidHjApprovalStatus != null and bidHjApprovalStatus != ''"> and q.bid_hj_approval_status = #{bidHjApprovalStatus}</if>
<if test="bidCode != null and bidCode != ''"> and q.bid_code like concat('%', #{bidCode}, '%')</if>
<if test="bidSalesmanName != null and bidSalesmanName != ''"> and q.bid_salesman_name like concat('%', #{bidSalesmanName}, '%')</if>
<if test="bidTenderingUnit != null and bidTenderingUnit != ''"> and q.bid_tendering_unit like concat('%', #{bidTenderingUnit}, '%')</if>
<if test="bidProject != null and bidProject != ''"> and q.bid_project like concat('%', #{bidProject}, '%')</if>
<!-- 数据范围过滤 -->
<!--${params.dataScope}-->
</where>
order by a.bid_hj_code desc
</select>
<select id="selectBidHjByBidHjId" parameterType="String" resultMap="BidHjResult">
<include refid="selectBidHjVo"/>
where a.bid_hj_id = #{bidHjId}
</select>
<insert id="insertBidHj" parameterType="BidHj">
insert into bid_hj
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="bidHjId != null">bid_hj_id,</if>
<if test="bidHjCode != null">bid_hj_code,</if>
<if test="bidHjPricingType != null">bid_hj_pricing_type,</if>
<if test="bidHjPricingDate != null">bid_hj_pricing_date,</if>
<if test="bidHjRemark != null">bid_hj_remark,</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="bidHjId != null">#{bidHjId},</if>
<if test="bidHjCode != null">#{bidHjCode},</if>
<if test="bidHjPricingType != null">#{bidHjPricingType},</if>
<if test="bidHjPricingDate != null">#{bidHjPricingDate},</if>
<if test="bidHjRemark != null">#{bidHjRemark},</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="updateBidHj" parameterType="BidHj">
update bid_hj
<trim prefix="SET" suffixOverrides=",">
<if test="bidHjCode != null">bid_hj_code = #{bidHjCode},</if>
<if test="bidHjPricingType != null">bid_hj_pricing_type = #{bidHjPricingType},</if>
<if test="bidHjPricingDate != null">bid_hj_pricing_date = #{bidHjPricingDate},</if>
<if test="bidHjRemark != null">bid_hj_remark = #{bidHjRemark},</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 bid_hj_id = #{bidHjId}
</update>
<delete id="deleteBidHjByBidHjId" parameterType="String">
delete from bid_hj where bid_hj_id = #{bidHjId}
</delete>
<delete id="deleteBidHjByBidHjIds" parameterType="String">
delete from bid_hj where bid_hj_id in
<foreach item="bidHjId" collection="array" open="(" separator="," close=")">
#{bidHjId}
</foreach>
</delete>
</mapper>