JNBusiness/ruoyi-system/src/main/resources/mapper/priceVerification/QuotHjMapper.xml

130 lines
6.9 KiB
XML
Raw Normal View History

2024-04-16 15:55:02 +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.priceVerification.mapper.QuotHjMapper">
2024-04-17 09:53:26 +08:00
2024-04-16 15:55:02 +08:00
<resultMap type="QuotHj" id="QuotHjResult">
<result property="quotHjId" column="quot_hj_id" />
<result property="quotHjCode" column="quot_hj_code" />
<result property="quotHjPricingType" column="quot_hj_pricing_type" />
<result property="quotHjPricingDate" column="quot_hj_pricing_date" />
<result property="quotHjRemark" column="quot_hj_remark" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
2024-04-17 09:53:26 +08:00
<result property="createName" column="create_name" />
2024-04-16 15:55:02 +08:00
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
2024-04-17 09:53:26 +08:00
2024-05-22 17:27:10 +08:00
<result property="quotId" column="quot_id" />
2024-04-17 09:53:26 +08:00
<result property="quotCode" column="quot_code" />
<result property="quotHjApprovalStatus" column="quot_hj_approval_status" />
<result property="quotSalesmanName" column="quot_salesman_name" />
<result property="quotCustomerName" column="quot_customer_name" />
<result property="quotProject" column="quot_project" />
2024-05-22 17:27:10 +08:00
2024-05-23 10:14:52 +08:00
<result property="quotJsxzConfirmId" column="quot_jsxz_confirm_id" />
2024-05-22 17:27:10 +08:00
<result property="quotJsxzGroupValues" column="quot_jsxz_group_values" />
2024-05-23 10:14:52 +08:00
<result property="quotJsqrTlApprovalStatus" column="quot_jsqr_tl_approval_status" />
<result property="quotJsqrTlRemark" column="quot_jsqr_tl_remark" />
<result property="quotJsqrDyApprovalStatus" column="quot_jsqr_dy_approval_status" />
<result property="quotJsqrDyRemark" column="quot_jsqr_dy_remark" />
<result property="quotJsqrZyApprovalStatus" column="quot_jsqr_zy_approval_status" />
<result property="quotJsqrZyRemark" column="quot_jsqr_zy_remark" />
<result property="quotJsqrQtApprovalStatus" column="quot_jsqr_qt_approval_status" />
<result property="quotJsqrQtRemark" column="quot_jsqr_qt_remark" />
2024-04-16 15:55:02 +08:00
</resultMap>
2024-04-17 09:53:26 +08:00
<sql id="quotHjJoins">
left join sys_user u on u.user_name=a.create_by
left join sys_dept d on u.dept_id = d.dept_id
2024-05-20 09:03:19 +08:00
left join quot q on q.quot_hj_id = a.quot_hj_id
2024-05-23 10:14:52 +08:00
left join quot_jsqr j on j.quot_jsqr_id = q.quot_jsxz_confirm_id
2024-04-17 09:53:26 +08:00
</sql>
2024-04-16 15:55:02 +08:00
<sql id="selectQuotHjVo">
2024-04-17 09:53:26 +08:00
select a.quot_hj_id, a.quot_hj_code, a.quot_hj_pricing_type, a.quot_hj_pricing_date, a.quot_hj_remark,
a.create_by, a.create_time, a.update_by, a.update_time,
u.nick_name create_name,
2024-05-23 10:14:52 +08:00
q.quot_hj_approval_status,q.quot_id,q.quot_code,q.quot_salesman_name,
2024-05-22 17:27:10 +08:00
q.quot_customer_name,q.quot_project,
2024-05-23 10:14:52 +08:00
q.quot_jsxz_confirm_id,q.quot_jsxz_group_values,
j.quot_jsqr_tl_approval_status,j.quot_jsqr_tl_remark,
j.quot_jsqr_dy_approval_status,j.quot_jsqr_dy_remark,
j.quot_jsqr_zy_approval_status,j.quot_jsqr_zy_remark,
j.quot_jsqr_qt_approval_status,j.quot_jsqr_qt_remark
2024-04-17 09:53:26 +08:00
from quot_hj a
<include refid="quotHjJoins"/>
2024-04-16 15:55:02 +08:00
</sql>
<select id="selectQuotHjList" parameterType="QuotHj" resultMap="QuotHjResult">
<include refid="selectQuotHjVo"/>
2024-04-17 09:53:26 +08:00
<where>
2024-04-16 15:55:02 +08:00
<if test="quotHjCode != null and quotHjCode != ''"> and quot_hj_code like concat('%', #{quotHjCode}, '%')</if>
<if test="params.beginQuotHjPricingDate != null and params.beginQuotHjPricingDate != '' and params.endQuotHjPricingDate != null and params.endQuotHjPricingDate != ''"> and quot_hj_pricing_date between #{params.beginQuotHjPricingDate} and #{params.endQuotHjPricingDate}</if>
2024-06-13 10:41:12 +08:00
<if test="quotHjApprovalStatus != null and quotHjApprovalStatus != ''"> and q.quot_hj_approval_status = #{quotHjApprovalStatus}</if>
2024-04-19 16:47:54 +08:00
<!-- 数据范围过滤 -->
<!--${params.dataScope}-->
2024-04-16 15:55:02 +08:00
</where>
2024-06-13 10:41:12 +08:00
order by a.quot_hj_code desc
2024-04-16 15:55:02 +08:00
</select>
2024-04-17 09:53:26 +08:00
2024-04-16 15:55:02 +08:00
<select id="selectQuotHjByQuotHjId" parameterType="String" resultMap="QuotHjResult">
<include refid="selectQuotHjVo"/>
2024-05-20 09:03:19 +08:00
where a.quot_hj_id = #{quotHjId}
2024-04-16 15:55:02 +08:00
</select>
2024-04-17 09:53:26 +08:00
2024-04-16 15:55:02 +08:00
<insert id="insertQuotHj" parameterType="QuotHj">
insert into quot_hj
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="quotHjId != null">quot_hj_id,</if>
<if test="quotHjCode != null">quot_hj_code,</if>
<if test="quotHjPricingType != null">quot_hj_pricing_type,</if>
<if test="quotHjPricingDate != null">quot_hj_pricing_date,</if>
<if test="quotHjRemark != null">quot_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="quotHjId != null">#{quotHjId},</if>
<if test="quotHjCode != null">#{quotHjCode},</if>
<if test="quotHjPricingType != null">#{quotHjPricingType},</if>
<if test="quotHjPricingDate != null">#{quotHjPricingDate},</if>
<if test="quotHjRemark != null">#{quotHjRemark},</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="updateQuotHj" parameterType="QuotHj">
update quot_hj
<trim prefix="SET" suffixOverrides=",">
<if test="quotHjCode != null">quot_hj_code = #{quotHjCode},</if>
<if test="quotHjPricingType != null">quot_hj_pricing_type = #{quotHjPricingType},</if>
<if test="quotHjPricingDate != null">quot_hj_pricing_date = #{quotHjPricingDate},</if>
<if test="quotHjRemark != null">quot_hj_remark = #{quotHjRemark},</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 quot_hj_id = #{quotHjId}
</update>
<delete id="deleteQuotHjByQuotHjId" parameterType="String">
delete from quot_hj where quot_hj_id = #{quotHjId}
</delete>
<delete id="deleteQuotHjByQuotHjIds" parameterType="String">
2024-04-17 09:53:26 +08:00
delete from quot_hj where quot_hj_id in
2024-04-16 15:55:02 +08:00
<foreach item="quotHjId" collection="array" open="(" separator="," close=")">
#{quotHjId}
</foreach>
</delete>
2024-04-17 09:53:26 +08:00
</mapper>