代码优化

This commit is contained in:
TL
2025-07-16 10:56:00 +08:00
parent 41e9c23924
commit 19d3c883fa
12 changed files with 152 additions and 52 deletions

View File

@ -29,30 +29,31 @@
<select id="selectCoscoSupplierSurveyList" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierSurvey" resultMap="CoscoSupplierSurveyResult">
<include refid="selectCoscoSupplierSurveyVo"/>
<where>
<if test="supplierId != null and supplierId != ''">
and supplier_id = #{supplierId}
</if>
<if test="supplierName != null and supplierName != ''">
and supplier_name like concat('%', #{supplierName}, '%')
</if>
<if test="name != null and name != ''">
and name like concat('%', #{name}, '%')
</if>
<if test="position != null and position != ''">
and position = #{position}
</if>
<if test="phone != null and phone != ''">
and phone = #{phone}
</if>
<if test="email != null and email != ''">
and email = #{email}
</if>
<if test="dateTime != null ">
and date_time = #{dateTime}
</if>
<if test="lastUpdateTime != null ">
and last_update_time = #{lastUpdateTime}
</if>
del_flag = 'normal'
<if test="supplierId != null and supplierId != ''">
and supplier_id = #{supplierId}
</if>
<if test="supplierName != null and supplierName != ''">
and supplier_name like concat('%', #{supplierName}, '%')
</if>
<if test="name != null and name != ''">
and name like concat('%', #{name}, '%')
</if>
<if test="position != null and position != ''">
and position = #{position}
</if>
<if test="phone != null and phone != ''">
and phone = #{phone}
</if>
<if test="email != null and email != ''">
and email = #{email}
</if>
<if test="dateTime != null ">
and date_time = #{dateTime}
</if>
<if test="lastUpdateTime != null ">
and last_update_time = #{lastUpdateTime}
</if>
</where>
</select>

View File

@ -15,35 +15,50 @@
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="lastUpdateTime" column="last_update_time"/>
<result property="questionName" column="question_name"/>
</resultMap>
<sql id="selectCoscoSupplierSurveyQuestionReplyVo">
select id, supplier_id, survey_question_id, reply_value, del_flag, create_by, create_time, update_by, update_time, last_update_time
from cosco_supplier_survey_question_reply
SELECT
cssqr.id,
cssqr.supplier_id,
cssqr.survey_question_id,
csq.question_name,
cssqr.reply_value,
cssqr.del_flag,
cssqr.create_by,
cssqr.create_time,
cssqr.update_by,
cssqr.update_time,
cssqr.last_update_time
FROM
cosco_supplier_survey_question_reply cssqr
LEFT JOIN cosco_survey_question csq ON cssqr.survey_question_id = csq.id
</sql>
<select id="selectCoscoSupplierSurveyQuestionReplyList" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierSurveyQuestionReply" resultMap="CoscoSupplierSurveyQuestionReplyResult">
<include refid="selectCoscoSupplierSurveyQuestionReplyVo"/>
<where>
<if test="supplierId != null and supplierId != ''">
and supplier_id = #{supplierId}
</if>
<if test="surveyQuestionId != null and surveyQuestionId != ''">
and survey_question_id = #{surveyQuestionId}
</if>
<if test="replyValue != null and replyValue != ''">
and reply_value = #{replyValue}
</if>
<if test="lastUpdateTime != null ">
and last_update_time = #{lastUpdateTime}
</if>
cssqr.del_flag = 'normal'
<if test="supplierId != null and supplierId != ''">
and cssqr.supplier_id = #{supplierId}
</if>
<if test="surveyQuestionId != null and surveyQuestionId != ''">
and cssqr.survey_question_id = #{surveyQuestionId}
</if>
<if test="replyValue != null and replyValue != ''">
and cssqr.reply_value = #{replyValue}
</if>
<if test="lastUpdateTime != null ">
and cssqr.last_update_time = #{lastUpdateTime}
</if>
</where>
</select>
<select id="selectCoscoSupplierSurveyQuestionReplyById" parameterType="String"
resultMap="CoscoSupplierSurveyQuestionReplyResult">
<include refid="selectCoscoSupplierSurveyQuestionReplyVo"/>
where id = #{id}
where cssqr.id = #{id}
</select>
<insert id="insertCoscoSupplierSurveyQuestionReply" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierSurveyQuestionReply">