|
@@ -4,6 +4,8 @@
|
|
|
<resultMap id="BaseResultMap" type="ComplaintDetectInfo" >
|
|
|
<id column="detect_id" property="detectId" jdbcType="INTEGER" />
|
|
|
<result column="customer_id" property="customerId" jdbcType="INTEGER" />
|
|
|
+ <result column="signclosed_id" property="signclosedId" jdbcType="INTEGER" />
|
|
|
+ <result column="product_id" property="productId" jdbcType="INTEGER" />
|
|
|
<result column="detect_product_type" property="detectProductType" jdbcType="BIT" />
|
|
|
<result column="detect_product_number" property="detectProductNumber" jdbcType="VARCHAR" />
|
|
|
<result column="detect_state" property="detectState" jdbcType="BIT" />
|
|
@@ -18,12 +20,14 @@
|
|
|
<result column="detect_desc" property="detectDesc" jdbcType="VARCHAR" />
|
|
|
<result column="signclosed_create_time" property="signclosedCreateTime" jdbcType="TIMESTAMP" />
|
|
|
<result column="signclosed_update_time" property="signclosedUpdateTime" jdbcType="TIMESTAMP" />
|
|
|
+ <result column="machine_no" property="machineNo" jdbcType="VARCHAR" />
|
|
|
+ <result column="detect_is_maintenance" property="detectIsMaintenance" jdbcType="VARCHAR" />
|
|
|
</resultMap>
|
|
|
<sql id="Base_Column_List" >
|
|
|
- detect_id, customer_id, detect_product_type, detect_product_number, detect_state,
|
|
|
+ detect_id, customer_id,signclosed_id,product_id, detect_product_type, detect_product_number, detect_state,
|
|
|
detect_phenomenon, detect_failure_classification, detect_failure_cause, detect_results,
|
|
|
detect_point, detect_analysis, detect_customer_id, detect_revolution_produced, detect_desc,
|
|
|
- signclosed_create_time, signclosed_update_time
|
|
|
+ signclosed_create_time, signclosed_update_time,detect_is_maintenance
|
|
|
</sql>
|
|
|
<select id="getComplaintDetectById" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
|
|
|
select
|
|
@@ -31,13 +35,79 @@
|
|
|
from tb_rst_complaint_detect
|
|
|
where detect_id = #{detectId,jdbcType=INTEGER}
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="listComplaintDetect" resultMap="BaseResultMap" parameterType="ComplaintDetectInfo" >
|
|
|
+ select
|
|
|
+ cd.detect_id detectId,
|
|
|
+ cd.signclosed_id signclosedId,
|
|
|
+ cd.product_id productId,
|
|
|
+ cd.customer_id customerId,
|
|
|
+ cd.detect_product_type detectProductType,
|
|
|
+ cd.detect_product_number detectProductNumber,
|
|
|
+ cd.detect_state detectState,
|
|
|
+ cd.detect_phenomenon detectPhenomenon,
|
|
|
+ cd.detect_failure_classification detectFailureClassification,
|
|
|
+ cd.detect_failure_cause detectFailureCause,
|
|
|
+ cd.detect_results detectResults,
|
|
|
+ cd.detect_point detectPoint,
|
|
|
+ cd.detect_analysis detectAnalysis,
|
|
|
+ cd.detect_customer_id detectCustomerId,
|
|
|
+ cd.detect_revolution_produced detectRevolutionProduced,
|
|
|
+ cd.detect_desc detectDesc,
|
|
|
+ cd.signclosed_create_time signclosedCreateTime,
|
|
|
+ cd.signclosed_update_time signclosedUpdateTime,
|
|
|
+ cd.machine_no machineNo,
|
|
|
+ cd.detect_is_maintenance
|
|
|
+ from tb_rst_complaint_detect cd LEFT JOIN tb_rst_customer_info ci ON cd.customer_id = ci.customer_id
|
|
|
+ <where>
|
|
|
+ <if test="detectProductType != null and detectProductType != ''">
|
|
|
+ cd.detect_product_type = #{detectProductType,jdbcType=BIT}
|
|
|
+ </if>
|
|
|
+ <if test="detectProductNumber != null and detectProductNumber != ''" >
|
|
|
+ AND cd.detect_product_number = #{detectProductNumber,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="detectState != null and detectState != ''" >
|
|
|
+ AND cd.detect_state = #{detectState,jdbcType=BIT}
|
|
|
+ </if>
|
|
|
+ <if test="detectPhenomenon != null and detectPhenomenon != ''" >
|
|
|
+ AND cd.detect_phenomenon like CONCAT('%',#{detectPhenomenon,jdbcType=VARCHAR},'%')
|
|
|
+ </if>
|
|
|
+ <if test="detectFailureClassification != null and detectFailureClassification != ''" >
|
|
|
+ AND cd.detect_failure_classification like CONCAT('%',#{detectFailureClassification,jdbcType=VARCHAR},'%')
|
|
|
+ </if>
|
|
|
+ <if test="detectFailureCause != null and detectFailureCause != ''" >
|
|
|
+ AND cd.detect_failure_cause like CONCAT('%',#{detectFailureCause,jdbcType=VARCHAR},'%')
|
|
|
+ </if>
|
|
|
+ <if test="detectResults != null and detectResults != ''" >
|
|
|
+ AND cd.detect_results like CONCAT('%',#{detectResults,jdbcType=VARCHAR},'%')
|
|
|
+ </if>
|
|
|
+ <if test="detectPoint != null and detectPoint != ''" >
|
|
|
+ AND cd.detect_point like CONCAT('%',#{detectPoint,jdbcType=VARCHAR},'%')
|
|
|
+ </if>
|
|
|
+ <if test="detectAnalysis != null and detectAnalysis != ''" >
|
|
|
+ AND cd.detect_analysis like CONCAT('%',#{detectAnalysis,jdbcType=VARCHAR},'%')
|
|
|
+ </if>
|
|
|
+ <if test="detectCustomerId != null and detectCustomerId != ''" >
|
|
|
+ AND cd.detect_customer_id = #{detectCustomerId,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="detectRevolutionProduced != null and detectRevolutionProduced != ''" >
|
|
|
+ AND cd.detect_revolution_produced = #{detectRevolutionProduced,jdbcType=BIT}
|
|
|
+ </if>
|
|
|
+ <if test="questionTitle != null and questionTitle != ''" >
|
|
|
+ AND ci.customer_question_title like CONCAT('%',#{questionTitle},'%')
|
|
|
+ </if>
|
|
|
+ <if test="detectIsMaintenance != null and detectIsMaintenance != ''" >
|
|
|
+ AND cd.detect_is_maintenance = #{detectIsMaintenance,jdbcType=BIT}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
<insert id="insert" parameterType="ComplaintDetectInfo" >
|
|
|
- insert into tb_rst_complaint_detect (detect_id, customer_id, detect_product_type,
|
|
|
+ insert into tb_rst_complaint_detect (detect_id, customer_id,signclosed_id,product_id, detect_product_type,
|
|
|
detect_product_number, detect_state, detect_phenomenon,
|
|
|
detect_failure_classification, detect_failure_cause,
|
|
|
detect_results, detect_point, detect_analysis,
|
|
|
detect_customer_id, detect_revolution_produced,
|
|
|
- detect_desc, signclosed_create_time, signclosed_update_time
|
|
|
+ detect_desc, signclosed_create_time, signclosed_update_time,machine_no,detect_is_maintenance
|
|
|
)
|
|
|
values (#{detectId,jdbcType=INTEGER}, #{customerId,jdbcType=INTEGER}, #{detectProductType,jdbcType=BIT},
|
|
|
#{detectProductNumber,jdbcType=VARCHAR}, #{detectState,jdbcType=BIT}, #{detectPhenomenon,jdbcType=VARCHAR},
|
|
@@ -45,6 +115,7 @@
|
|
|
#{detectResults,jdbcType=VARCHAR}, #{detectPoint,jdbcType=VARCHAR}, #{detectAnalysis,jdbcType=VARCHAR},
|
|
|
#{detectCustomerId,jdbcType=INTEGER}, #{detectRevolutionProduced,jdbcType=BIT},
|
|
|
#{detectDesc,jdbcType=VARCHAR}, #{signclosedCreateTime,jdbcType=TIMESTAMP}, #{signclosedUpdateTime,jdbcType=TIMESTAMP}
|
|
|
+ ,#{machineNo,jdbcType=TIMESTAMP},#{detectIsMaintenance,jdbcType=BIT}
|
|
|
)
|
|
|
</insert>
|
|
|
|
|
@@ -96,6 +167,9 @@
|
|
|
<if test="signclosedUpdateTime != null" >
|
|
|
signclosed_update_time = #{signclosedUpdateTime,jdbcType=TIMESTAMP},
|
|
|
</if>
|
|
|
+ <if test="detectIsMaintenance != null" >
|
|
|
+ detect_is_maintenance = #{detectIsMaintenance,jdbcType=TIMESTAMP}
|
|
|
+ </if>
|
|
|
</set>
|
|
|
where detect_id = #{detectId,jdbcType=INTEGER}
|
|
|
</update>
|