2025-05-30 02:10:24 +00: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.sip.mapper.ProjectInfoMapper" >
<resultMap type= "ProjectInfo" id= "ProjectInfoResult" >
<result property= "id" column= "id" />
<result property= "projectCode" column= "project_code" />
<result property= "projectName" column= "project_name" />
<result property= "customerCode" column= "customer_code" />
<result property= "customerName" column= "customer_name" />
<result property= "industryType" column= "industry_type" />
2025-06-04 06:13:02 +00:00
2025-05-30 02:10:24 +00:00
<result property= "projectStage" column= "project_stage" />
<result property= "projectGraspDegree" column= "project_grasp_degree" />
<result property= "hzSupportUser" column= "hz_support_user" />
<result property= "operateInstitution" column= "operate_institution" />
<result property= "partnerCode" column= "partner_code" />
<result property= "contactWay" column= "contact_way" />
<result property= "estimatedAmount" column= "estimated_amount" />
<result property= "currencyType" column= "currency_type" />
<result property= "estimatedOrderTime" column= "estimated_order_time" />
<result property= "estimatedDeliverTime" column= "estimated_deliver_time" />
<result property= "competitor" column= "competitor" />
<result property= "countryProduct" column= "country_product" />
<result property= "serverConfiguration" column= "server_configuration" />
<result property= "keyProblem" column= "key_problem" />
<result property= "projectDesc" column= "project_desc" />
<result property= "createBy" column= "create_by" />
<result property= "createTime" column= "create_time" />
<result property= "updateBy" column= "update_by" />
<result property= "updateTime" column= "update_time" />
2025-06-04 02:03:17 +00:00
<result property= "bgProperty" column= "bg_property" />
2025-05-30 02:10:24 +00:00
</resultMap>
<sql id= "selectProjectInfoVo" >
2025-06-04 03:25:20 +00:00
select id, project_code, project_name,bg_property, customer_code, customer_name, industry_type, agent_code, project_stage, project_grasp_degree, hz_support_user, operate_institution
2025-05-30 03:56:17 +00:00
, partner_code, partner_name, contact_way, estimated_amount, currency_type, estimated_order_time, estimated_deliver_time, competitor, country_product, server_configuration
2025-06-13 02:44:54 +00:00
, key_problem, project_desc, create_by, create_time, update_by, update_time,customer_user_name,customer_phone,partner_email,partner_user_name,h3c_person,h3c_phone,poc from project_info t1
2025-06-04 03:25:20 +00:00
</sql>
<sql id= "selectRelationProjectInfoVo" >
select t1.id,
t1.project_code,
t1.project_name,
t1.bg_property,
t1.customer_code,
t1.customer_name,
t1.industry_type,
t1.agent_code,
t1.project_stage,
t1.project_grasp_degree,
t1.hz_support_user,
t1.operate_institution,
t1.partner_code,
t1.partner_name,
t1.contact_way,
t1.estimated_amount,
t1.currency_type,
t1.estimated_order_time,
t1.estimated_deliver_time,
t1.competitor,
t1.country_product,
t1.server_configuration,
t1.key_problem,
t1.project_desc,
t1.create_by,
t1.create_time,
t1.update_by,
t1.update_time,
2025-06-13 02:44:54 +00:00
t1.customer_user_name,t1.customer_phone,t1.partner_email,t1.partner_user_name,t1.h3c_person,t1.poc,t1.h3c_phone,
2025-06-10 08:44:04 +00:00
t2.agent_name,t2.contact_email,t2.contact_phone,t2.contact_person,
2025-06-05 07:02:21 +00:00
t3.user_name as hz_support_user_name
2025-06-04 03:25:20 +00:00
from project_info t1
left join agent_info t2 on t1.agent_code = t2.agent_code
2025-06-05 07:02:21 +00:00
left join sys_user t3 on t1.hz_support_user=t3.user_id
2025-05-30 02:10:24 +00:00
</sql>
<select id= "selectProjectInfoList" parameterType= "ProjectInfo" resultMap= "ProjectInfoResult" >
2025-06-06 03:32:27 +00:00
<include refid= "selectRelationProjectInfoVo" />
2025-06-06 09:17:39 +00:00
<where >
2025-06-04 03:25:20 +00:00
<if test= "projectCode != null and projectCode != ''" > and t1.project_code = #{projectCode}</if>
<if test= "projectName != null and projectName != ''" > and t1.project_name like concat('%', #{projectName}, '%')</if>
2025-06-13 02:44:54 +00:00
<if test= "poc != null and poc != ''" > and t1.poc =#{poc}</if>
2025-06-04 03:25:20 +00:00
<if test= "customerCode != null and customerCode != ''" > and t1.customer_code = #{customerCode}</if>
<if test= "agentCode != null and agentCode != ''" > and t1.agent_code = #{agentCode}</if>
2025-06-06 09:17:39 +00:00
<if test= "agentName != null and agentName != ''" > and t2.agent_name like concat('%', #{agentName}, '%')</if>
2025-06-04 03:25:20 +00:00
<if test= "customerName != null and customerName != ''" > and t1.customer_name like concat('%', #{customerName}, '%')</if>
<if test= "industryType != null and industryType != ''" > and t1.industry_type = #{industryType}</if>
<if test= "bgProperty != null and bgProperty != ''" > and t1.bg_property = #{bgProperty}</if>
2025-06-04 06:13:02 +00:00
2025-06-04 03:25:20 +00:00
<if test= "projectStage != null and projectStage != ''" > and t1.project_stage = #{projectStage}</if>
<if test= "projectGraspDegree != null and projectGraspDegree != ''" > and t1.project_grasp_degree = #{projectGraspDegree}</if>
<if test= "hzSupportUser != null and hzSupportUser != ''" > and t1.hz_support_user = #{hzSupportUser}</if>
2025-06-09 07:52:58 +00:00
<if test= "hzSupportUserName != null and hzSupportUserName != ''" > and t3.user_name like concat('%', #{hzSupportUserName}, '%')</if>
2025-06-04 03:25:20 +00:00
<if test= "operateInstitution != null and operateInstitution != ''" > and t1.operate_institution = #{operateInstitution}</if>
<if test= "partnerCode != null and partnerCode != ''" > and t1.partner_code = #{partnerCode}</if>
<if test= "partnerName != null and partnerName != ''" > and t1.partner_name = #{partnerName}</if>
<if test= "contactWay != null and contactWay != ''" > and t1.contact_way = #{contactWay}</if>
<if test= "estimatedAmount != null " > and t1.estimated_amount = #{estimatedAmount}</if>
<if test= "currencyType != null and currencyType != ''" > and t1.currency_type = #{currencyType}</if>
<if test= "estimatedOrderTime != null " > and t1.estimated_order_time = #{estimatedOrderTime}</if>
2025-05-30 08:27:52 +00:00
<if test= "estimatedOrderTimeStart != null or estimatedOrderTimeEnd != null" >
<choose >
2025-06-03 07:35:36 +00:00
<when test= "estimatedOrderTimeStart != null and estimatedOrderTimeEnd != null" >
2025-06-04 03:25:20 +00:00
and t1.estimated_order_time between date_format(#{estimatedOrderTimeStart}, '%Y-%m-%d 00:00:00') and date_format(#{estimatedOrderTimeEnd}, '%Y-%m-%d 23:59:59')
2025-06-03 07:35:36 +00:00
</when>
2025-05-30 08:27:52 +00:00
<when test= "estimatedOrderTimeStart != null" >
2025-06-04 03:25:20 +00:00
and t1.estimated_order_time <![CDATA[ >= ]]> date_format(#{estimatedOrderTimeStart}, '%Y-%m-%d 00:00:00')
2025-05-30 08:27:52 +00:00
</when>
<when test= "estimatedOrderTimeEnd != null" >
2025-06-04 03:25:20 +00:00
and t1.estimated_order_time <![CDATA[ <= ]]> date_format(#{estimatedOrderTimeEnd}, '%Y-%m-%d 23:59:59')
2025-05-30 08:27:52 +00:00
</when>
2025-06-03 07:35:36 +00:00
2025-05-30 08:27:52 +00:00
</choose>
</if>
2025-06-04 03:25:20 +00:00
<if test= "estimatedDeliverTime != null " > and t1.estimated_deliver_time = #{estimatedDeliverTime}</if>
2025-05-30 08:27:52 +00:00
<if test= "estimatedDeliverTimeStart != null or estimatedDeliverTimeEnd != null" >
<choose >
2025-06-03 07:35:36 +00:00
<when test= "estimatedDeliverTimeStart != null and estimatedDeliverTimeEnd != null" >
2025-06-04 03:25:20 +00:00
and t1.estimated_deliver_time between date_format(#{estimatedDeliverTimeStart}, '%Y-%m-%d 00:00:00') and date_format(#{estimatedDeliverTimeEnd}, '%Y-%m-%d 23:59:59')
2025-06-03 07:35:36 +00:00
</when>
2025-05-30 08:27:52 +00:00
<when test= "estimatedDeliverTimeStart != null" >
2025-06-04 03:25:20 +00:00
and t1.estimated_deliver_time <![CDATA[ >= ]]> date_format(#{estimatedDeliverTimeStart}, '%Y-%m-%d 00:00:00')
2025-05-30 08:27:52 +00:00
</when>
<when test= "estimatedDeliverTimeEnd != null" >
2025-06-04 03:25:20 +00:00
and t1.estimated_deliver_time <![CDATA[ <= ]]> date_format(#{estimatedDeliverTimeEnd}, '%Y-%m-%d 23:59:59')
2025-05-30 08:27:52 +00:00
</when>
2025-06-03 07:35:36 +00:00
2025-05-30 08:27:52 +00:00
</choose>
</if>
<if test= "updateTimeStart != null or updateTimeEnd != null" >
<choose >
2025-06-03 07:35:36 +00:00
<when test= "updateTimeStart != null and updateTimeEnd != null" >
2025-06-04 03:25:20 +00:00
and t1.update_time between date_format(#{updateTimeStart}, '%Y-%m-%d 00:00:00') and date_format(#{updateTimeEnd}, '%Y-%m-%d 23:59:59')
2025-06-03 07:35:36 +00:00
</when>
2025-05-30 08:27:52 +00:00
<when test= "updateTimeStart != null" >
2025-06-04 03:25:20 +00:00
and t1.update_time <![CDATA[ >= ]]> date_format(#{updateTimeStart}, '%Y-%m-%d 00:00:00')
2025-05-30 08:27:52 +00:00
</when>
<when test= "updateTimeEnd != null" >
2025-06-04 03:25:20 +00:00
and t1.update_time <![CDATA[ <= ]]> date_format(#{updateTimeEnd}, '%Y-%m-%d 23:59:59')
2025-05-30 08:27:52 +00:00
</when>
2025-06-03 07:35:36 +00:00
2025-05-30 08:27:52 +00:00
</choose>
</if>
2025-06-04 03:25:20 +00:00
<if test= "competitor != null and competitor != ''" > and t1.competitor = #{competitor}</if>
<if test= "countryProduct != null and countryProduct != ''" > and t1.country_product = #{countryProduct}</if>
<if test= "serverConfiguration != null and serverConfiguration != ''" > and t1.server_configuration = #{serverConfiguration}</if>
<if test= "keyProblem != null and keyProblem != ''" > and t1.key_problem = #{keyProblem}</if>
<if test= "projectDesc != null and projectDesc != ''" > and t1.project_desc = #{projectDesc}</if>
2025-05-30 02:10:24 +00:00
</where>
</select>
<select id= "selectProjectInfoById" parameterType= "Long" resultMap= "ProjectInfoResult" >
2025-06-04 03:25:20 +00:00
<include refid= "selectRelationProjectInfoVo" />
where t1.id = #{id}
2025-05-30 02:10:24 +00:00
</select>
<select id= "selectMaxProjectCode" resultType= "java.lang.String" >
2025-06-06 09:17:39 +00:00
select max(project_code) from project_info
2025-05-30 02:10:24 +00:00
</select>
2025-05-30 03:56:17 +00:00
<select id= "selectUserById" resultType= "com.ruoyi.common.core.domain.entity.SysUser" >
select * from sys_user
2025-06-03 01:25:00 +00:00
where user_id in <foreach collection= "list" item= "id" open= "(" separator= "," close= ")" >
2025-05-30 03:56:17 +00:00
#{id}
</foreach>
</select>
2025-05-30 02:10:24 +00:00
<insert id= "insertProjectInfo" parameterType= "ProjectInfo" useGeneratedKeys= "true" keyProperty= "id" >
insert into project_info
<trim prefix= "(" suffix= ")" suffixOverrides= "," >
<if test= "projectCode != null" > project_code,</if>
<if test= "projectName != null" > project_name,</if>
2025-06-13 02:44:54 +00:00
<if test= "poc != null" > poc,</if>
2025-05-30 02:10:24 +00:00
<if test= "customerCode != null" > customer_code,</if>
<if test= "customerName != null" > customer_name,</if>
2025-06-09 01:47:33 +00:00
<if test= "customerUserName != null" > customer_user_name,</if>
<if test= "customerPhone != null" > customer_phone,</if>
2025-06-11 08:15:09 +00:00
<if test= "h3cPerson != null" > h3c_person,</if>
<if test= "h3cPhone != null" > h3c_phone,</if>
2025-05-30 02:10:24 +00:00
<if test= "industryType != null" > industry_type,</if>
2025-06-04 02:03:17 +00:00
<if test= "bgProperty != null" > bg_property,</if>
2025-06-04 03:25:20 +00:00
<if test= "agentCode != null" > agent_code,</if>
2025-05-30 02:10:24 +00:00
<if test= "projectStage != null" > project_stage,</if>
<if test= "projectGraspDegree != null" > project_grasp_degree,</if>
<if test= "hzSupportUser != null" > hz_support_user,</if>
<if test= "operateInstitution != null" > operate_institution,</if>
<if test= "partnerCode != null" > partner_code,</if>
2025-05-30 03:56:17 +00:00
<if test= "partnerName != null" > partner_name,</if>
2025-06-10 08:44:04 +00:00
<if test= "partnerUserName != null" > partner_user_name,</if>
2025-06-09 03:05:18 +00:00
<if test= "partnerEmail != null" > partner_email,</if>
2025-05-30 02:10:24 +00:00
<if test= "contactWay != null" > contact_way,</if>
<if test= "estimatedAmount != null" > estimated_amount,</if>
<if test= "currencyType != null" > currency_type,</if>
<if test= "estimatedOrderTime != null" > estimated_order_time,</if>
<if test= "estimatedDeliverTime != null" > estimated_deliver_time,</if>
<if test= "competitor != null" > competitor,</if>
<if test= "countryProduct != null" > country_product,</if>
<if test= "serverConfiguration != null" > server_configuration,</if>
<if test= "keyProblem != null" > key_problem,</if>
<if test= "projectDesc != null" > project_desc,</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= "projectCode != null" > #{projectCode},</if>
<if test= "projectName != null" > #{projectName},</if>
2025-06-13 02:44:54 +00:00
<if test= "poc != null" > #{poc},</if>
2025-05-30 02:10:24 +00:00
<if test= "customerCode != null" > #{customerCode},</if>
<if test= "customerName != null" > #{customerName},</if>
2025-06-09 01:47:33 +00:00
<if test= "customerUserName != null" > #{customerUserName},</if>
<if test= "customerPhone != null" > #{customerPhone},</if>
2025-06-11 08:15:09 +00:00
<if test= "h3cPerson != null" > #{h3cPerson},</if>
<if test= "h3cPhone != null" > #{h3cPhone},</if>
2025-05-30 02:10:24 +00:00
<if test= "industryType != null" > #{industryType},</if>
2025-06-04 02:03:17 +00:00
<if test= "bgProperty != null" > #{bgProperty},</if>
2025-06-04 03:25:20 +00:00
<if test= "agentCode != null" > #{agentCode},</if>
2025-05-30 02:10:24 +00:00
<if test= "projectStage != null" > #{projectStage},</if>
<if test= "projectGraspDegree != null" > #{projectGraspDegree},</if>
<if test= "hzSupportUser != null" > #{hzSupportUser},</if>
<if test= "operateInstitution != null" > #{operateInstitution},</if>
<if test= "partnerCode != null" > #{partnerCode},</if>
2025-05-30 03:56:17 +00:00
<if test= "partnerName != null" > #{partnerName},</if>
2025-06-10 08:44:04 +00:00
<if test= "partnerUserName != null" > #{partnerUserName},</if>
2025-06-09 03:05:18 +00:00
<if test= "partnerEmail != null" > #{partnerEmail},</if>
2025-05-30 02:10:24 +00:00
<if test= "contactWay != null" > #{contactWay},</if>
<if test= "estimatedAmount != null" > #{estimatedAmount},</if>
<if test= "currencyType != null" > #{currencyType},</if>
<if test= "estimatedOrderTime != null" > #{estimatedOrderTime},</if>
<if test= "estimatedDeliverTime != null" > #{estimatedDeliverTime},</if>
<if test= "competitor != null" > #{competitor},</if>
<if test= "countryProduct != null" > #{countryProduct},</if>
<if test= "serverConfiguration != null" > #{serverConfiguration},</if>
<if test= "keyProblem != null" > #{keyProblem},</if>
<if test= "projectDesc != null" > #{projectDesc},</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= "updateProjectInfo" parameterType= "ProjectInfo" >
update project_info
<trim prefix= "SET" suffixOverrides= "," >
<if test= "projectCode != null" > project_code = #{projectCode},</if>
<if test= "projectName != null" > project_name = #{projectName},</if>
2025-06-13 02:44:54 +00:00
<if test= "poc != null" > poc = #{poc},</if>
2025-05-30 02:10:24 +00:00
<if test= "customerCode != null" > customer_code = #{customerCode},</if>
<if test= "customerName != null" > customer_name = #{customerName},</if>
2025-06-09 01:47:33 +00:00
<if test= "customerUserName != null" > customer_user_name=#{customerUserName},</if>
<if test= "customerPhone != null" > customer_phone=#{customerPhone},</if>
2025-06-11 08:15:09 +00:00
<if test= "h3cPhone != null" > h3c_phone=#{h3cPhone},</if>
<if test= "h3cPerson != null" > h3c_person=#{h3cPerson},</if>
2025-06-04 02:03:17 +00:00
<if test= "bgProperty != null" > bg_property=#{bgProperty},</if>
2025-05-30 02:10:24 +00:00
<if test= "industryType != null" > industry_type = #{industryType},</if>
2025-06-04 03:25:20 +00:00
<if test= "agentCode != null" > agent_code = #{agentCode},</if>
2025-05-30 02:10:24 +00:00
<if test= "projectStage != null" > project_stage = #{projectStage},</if>
<if test= "projectGraspDegree != null" > project_grasp_degree = #{projectGraspDegree},</if>
<if test= "hzSupportUser != null" > hz_support_user = #{hzSupportUser},</if>
<if test= "operateInstitution != null" > operate_institution = #{operateInstitution},</if>
2025-05-30 03:56:17 +00:00
partner_code = #{partnerCode},
<if test= "partnerName != null" > partner_name = #{partnerName},</if>
2025-06-10 08:44:04 +00:00
<if test= "partnerUserName != null" > partner_user_name = #{partnerUserName},</if>
2025-06-09 03:05:18 +00:00
<if test= "partnerEmail != null" > partner_email=#{partnerEmail},</if>
2025-05-30 02:10:24 +00:00
<if test= "contactWay != null" > contact_way = #{contactWay},</if>
<if test= "estimatedAmount != null" > estimated_amount = #{estimatedAmount},</if>
<if test= "currencyType != null" > currency_type = #{currencyType},</if>
<if test= "estimatedOrderTime != null" > estimated_order_time = #{estimatedOrderTime},</if>
<if test= "estimatedDeliverTime != null" > estimated_deliver_time = #{estimatedDeliverTime},</if>
<if test= "competitor != null" > competitor = #{competitor},</if>
<if test= "countryProduct != null" > country_product = #{countryProduct},</if>
<if test= "serverConfiguration != null" > server_configuration = #{serverConfiguration},</if>
<if test= "keyProblem != null" > key_problem = #{keyProblem},</if>
<if test= "projectDesc != null" > project_desc = #{projectDesc},</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 id = #{id}
</update>
<delete id= "deleteProjectInfoById" parameterType= "Long" >
delete from project_info where id = #{id}
</delete>
<delete id= "deleteProjectInfoByIds" parameterType= "String" >
delete from project_info where id in
<foreach item= "id" collection= "array" open= "(" separator= "," close= ")" >
#{id}
</foreach>
</delete>
</mapper>