|
@@ -10,16 +10,22 @@
|
|
|
<result column="maintenance_state" property="maintenanceState" jdbcType="INTEGER" />
|
|
|
<result column="maintenance_analysis" property="maintenanceAnalysis" jdbcType="VARCHAR" />
|
|
|
<result column="maintenance_customer_id" property="maintenanceCustomerId" jdbcType="INTEGER" />
|
|
|
- <result column="maintenance_id_repair" property="maintenanceIdRepair" jdbcType="INTEGER" />
|
|
|
+ <result column="maintenance_is_repair" property="maintenanceIsRepair" jdbcType="INTEGER" />
|
|
|
<result column="maintenance_content_date" property="maintenanceContentDate" jdbcType="TIMESTAMP" />
|
|
|
<result column="maintenance_create_time" property="maintenanceCreateTime" jdbcType="TIMESTAMP" />
|
|
|
<result column="maintenance_update_time" property="maintenanceUpdateTime" jdbcType="TIMESTAMP" />
|
|
|
+ <result column="maintenance_is_warehousing" property="maintenanceIsWarehousing" jdbcType="INTEGER" />
|
|
|
+ <result column="maintenance_desc" property="maintenanceDesc" jdbcType="VARCHAR" />
|
|
|
+ <result column="product_color_id" property="productColorId" jdbcType="INTEGER" />
|
|
|
+
|
|
|
+
|
|
|
</resultMap>
|
|
|
<sql id="Base_Column_List" >
|
|
|
maintenance_id, detect_id, maintenance_equipment_number, product_id,
|
|
|
maintenance_product_number, maintenance_state, maintenance_analysis,
|
|
|
- maintenance_customer_id, maintenance_id_repair,maintenance_content_date,
|
|
|
- maintenance_create_time, maintenance_update_time
|
|
|
+ maintenance_customer_id, maintenance_is_repair,maintenance_content_date,
|
|
|
+ maintenance_create_time, maintenance_update_time,maintenance_is_warehousing,maintenance_desc,
|
|
|
+ product_color_id
|
|
|
</sql>
|
|
|
<select id="getMaintenanceByid" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
|
|
|
select
|
|
@@ -27,68 +33,117 @@
|
|
|
from tb_rst_complaint_maintenance
|
|
|
where maintenance_id = #{maintenanceId,jdbcType=INTEGER}
|
|
|
</select>
|
|
|
- <select id="listMaintenance" resultMap="BaseResultMap" parameterType="ComplaintMaintenanceInfo" >
|
|
|
+
|
|
|
+ <resultMap id="listMaintenanceMap" type="ComplaintMaintenanceInfo" >
|
|
|
+ <id column="maintenance_id" property="maintenanceId" jdbcType="INTEGER" />
|
|
|
+ <result column="detect_id" property="detectId" jdbcType="INTEGER" />
|
|
|
+ <result column="maintenance_equipment_number" property="maintenanceEquipmentNumber" jdbcType="VARCHAR" />
|
|
|
+ <result column="product_id" property="productId" jdbcType="INTEGER" />
|
|
|
+ <result column="maintenance_product_number" property="maintenanceProductNumber" jdbcType="VARCHAR" />
|
|
|
+ <result column="maintenance_state" property="maintenanceState" jdbcType="INTEGER" />
|
|
|
+ <result column="maintenance_analysis" property="maintenanceAnalysis" jdbcType="VARCHAR" />
|
|
|
+ <result column="maintenance_customer_id" property="maintenanceCustomerId" jdbcType="INTEGER" />
|
|
|
+ <result column="maintenance_is_repair" property="maintenanceIsRepair" jdbcType="INTEGER" />
|
|
|
+ <result column="maintenance_content_date" property="maintenanceContentDate" jdbcType="TIMESTAMP" />
|
|
|
+ <result column="maintenance_create_time" property="maintenanceCreateTime" jdbcType="TIMESTAMP" />
|
|
|
+ <result column="maintenance_update_time" property="maintenanceUpdateTime" jdbcType="TIMESTAMP" />
|
|
|
+ <result column="maintenance_is_warehousing" property="maintenanceIsWarehousing" jdbcType="INTEGER" />
|
|
|
+ <result column="maintenance_desc" property="maintenanceDesc" jdbcType="VARCHAR" />
|
|
|
+ <result column="product_color_id" property="productColorId" jdbcType="VARCHAR" />
|
|
|
+ <collection property="equipmentNumber" column="maintenance_equipment_number" ofType="String" select="selectEquipmentNumber"/>
|
|
|
+ </resultMap>
|
|
|
+ <select id="selectEquipmentNumber" resultType="Integer" parameterType="String" >
|
|
|
select
|
|
|
- maintenance_id maintenanceId,
|
|
|
- detect_id detectId,
|
|
|
- maintenance_equipment_number maintenanceEquipmentNumber,
|
|
|
- product_id productId,
|
|
|
- maintenance_product_number maintenanceProductNumber,
|
|
|
- maintenance_state maintenanceState,
|
|
|
- maintenance_analysis maintenanceAnalysis,
|
|
|
- maintenance_customer_id maintenanceCustomerId,
|
|
|
- maintenance_id_repair maintenanceIdRepair,
|
|
|
- maintenance_content_date maintenanceContentDate,
|
|
|
- maintenance_create_time maintenanceCreateTime,
|
|
|
- maintenance_update_time maintenanceUpdateTime
|
|
|
+ COUNT(*)
|
|
|
from tb_rst_complaint_maintenance
|
|
|
+ where maintenance_equipment_number = #{maintenanceEquipmentNumber}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="listMaintenance" resultMap="listMaintenanceMap" parameterType="ComplaintMaintenanceInfo" >
|
|
|
+ select
|
|
|
+ cm.maintenance_id,
|
|
|
+ cm.detect_id,
|
|
|
+ cm.maintenance_equipment_number,
|
|
|
+ cm.product_id,
|
|
|
+ cm.maintenance_product_number,
|
|
|
+ cm.maintenance_state,
|
|
|
+ cm.maintenance_analysis,
|
|
|
+ cm.maintenance_customer_id,
|
|
|
+ cm.maintenance_is_repair,
|
|
|
+ cm.maintenance_content_date,
|
|
|
+ cm.maintenance_create_time,
|
|
|
+ cm.maintenance_update_time,
|
|
|
+ cm.maintenance_is_warehousing,
|
|
|
+ cm.maintenance_desc,
|
|
|
+ cm.product_color_id,
|
|
|
+ pi.product_type productType,
|
|
|
+ cd.maintenance_results maintenanceResults,
|
|
|
+ cd.detect_desc detectDesc,
|
|
|
+ qd.describe_title customerIdDescribe
|
|
|
+ from tb_rst_complaint_maintenance cm
|
|
|
+ LEFT JOIN tb_rst_product_info pi on cm.product_id = pi.product_id
|
|
|
+ LEFT JOIN tb_rst_complaint_detect cd on cm.detect_id = cd.detect_id
|
|
|
+ LEFT JOIN tb_rst_question_describe qd on cm.maintenance_customer_id = qd.customer_id
|
|
|
<where>
|
|
|
<if test="maintenanceId != null and maintenanceId != ''" >
|
|
|
AND maintenance_id = #{maintenanceId}
|
|
|
</if>
|
|
|
<if test="detectId != null and detectId != ''" >
|
|
|
- AND detect_id = #{detectId}
|
|
|
+ AND cm.detect_id = #{detectId}
|
|
|
</if>
|
|
|
- <if test="maintenanceEquipmentNumber != null maintenanceEquipmentNumber != ''" >
|
|
|
+ <if test="maintenanceEquipmentNumber != null and maintenanceEquipmentNumber != ''" >
|
|
|
AND maintenance_equipment_number = #{maintenanceEquipmentNumber}
|
|
|
</if>
|
|
|
- <if test="maintenanceState != null maintenanceState != ''" >
|
|
|
- AND maintenance_state = #{maintenanceEquipmentNumber}
|
|
|
+ <if test="maintenanceState != null and maintenanceState != ''" >
|
|
|
+ AND maintenance_state = #{maintenanceState}
|
|
|
</if>
|
|
|
- <if test="maintenanceAnalysis != null maintenanceAnalysis != ''" >
|
|
|
+ <if test="maintenanceAnalysis != null and maintenanceAnalysis != ''" >
|
|
|
AND maintenance_analysis = #{maintenanceAnalysis}
|
|
|
</if>
|
|
|
- <if test="maintenanceCustomerId != null maintenanceCustomerId != ''" >
|
|
|
+ <if test="maintenanceCustomerId != null and maintenanceCustomerId != ''" >
|
|
|
AND maintenance_customer_id = #{maintenanceCustomerId}
|
|
|
</if>
|
|
|
- <if test="maintenanceIdRepair != null maintenanceIdRepair != ''" >
|
|
|
- AND maintenance_id_repair = #{maintenanceIdRepair}
|
|
|
+ <if test="maintenanceIsRepair != null and maintenanceIsRepair != ''" >
|
|
|
+ AND maintenance_is_repair = #{maintenanceIsRepair}
|
|
|
</if>
|
|
|
- <if test="maintenanceContentDate != null maintenanceContentDate != ''" >
|
|
|
+ <if test="maintenanceContentDate != null and maintenanceContentDate != ''" >
|
|
|
AND maintenance_content_date = #{maintenanceContentDate}
|
|
|
</if>
|
|
|
- <if test="maintenanceCreateTime != null maintenanceCreateTime != ''" >
|
|
|
+ <if test="maintenanceCreateTime != null and maintenanceCreateTime != ''" >
|
|
|
AND maintenance_create_time = #{maintenanceCreateTime}
|
|
|
</if>
|
|
|
- <if test="maintenanceUpdateTime != null maintenanceUpdateTime != ''" >
|
|
|
+ <if test="maintenanceUpdateTime != null and maintenanceUpdateTime != ''" >
|
|
|
AND maintenanceUpdateTime = #{maintenanceUpdateTime}
|
|
|
</if>
|
|
|
+ <if test="customerIdDescribe != null and customerIdDescribe != ''" >
|
|
|
+ AND qd.describe_title like CONCAT('%',#{customerIdDescribe},'%')
|
|
|
+ </if>
|
|
|
+ <if test="maintenanceResults != null and maintenanceResults != ''" >
|
|
|
+ AND cd.maintenance_results = #{maintenanceResults}
|
|
|
+ </if>
|
|
|
+ <if test="productColorId != null and productColorId != ''" >
|
|
|
+ AND product_color_id = #{productColorId}
|
|
|
+ </if>
|
|
|
</where>
|
|
|
</select>
|
|
|
<insert id="insert" parameterType="ComplaintMaintenanceInfo" >
|
|
|
insert into tb_rst_complaint_maintenance (maintenance_id, detect_id, maintenance_equipment_number,
|
|
|
product_id, maintenance_product_number,
|
|
|
maintenance_state, maintenance_analysis,
|
|
|
- maintenance_customer_id, maintenance_id_repair,
|
|
|
+ maintenance_customer_id, maintenance_is_repair,
|
|
|
maintenance_content_date,
|
|
|
- maintenance_create_time, maintenance_update_time
|
|
|
+ maintenance_create_time, maintenance_update_time,
|
|
|
+ maintenance_is_warehousing,
|
|
|
+ maintenance_desc,product_color_id
|
|
|
)
|
|
|
values (#{maintenanceId,jdbcType=INTEGER}, #{detectId,jdbcType=INTEGER}, #{maintenanceEquipmentNumber,jdbcType=INTEGER},
|
|
|
#{productId,jdbcType=BIT}, #{maintenanceProductNumber,jdbcType=VARCHAR},
|
|
|
#{maintenanceState,jdbcType=INTEGER}, #{maintenanceAnalysis,jdbcType=VARCHAR},
|
|
|
- #{maintenanceCustomerId,jdbcType=INTEGER}, #{maintenanceIdRepair,jdbcType=INTEGER},
|
|
|
+ #{maintenanceCustomerId,jdbcType=INTEGER}, #{maintenanceIsRepair,jdbcType=INTEGER},
|
|
|
#{maintenanceContentDate,jdbcType=TIMESTAMP},
|
|
|
#{maintenanceCreateTime,jdbcType=TIMESTAMP}, #{maintenanceUpdateTime,jdbcType=TIMESTAMP}
|
|
|
+ , #{maintenanceIsWarehousing,jdbcType=INTEGER}, #{maintenanceDesc,jdbcType=VARCHAR}
|
|
|
+ , #{productColorId,jdbcType=INTEGER}
|
|
|
)
|
|
|
</insert>
|
|
|
|
|
@@ -116,8 +171,8 @@
|
|
|
<if test="maintenanceCustomerId != null" >
|
|
|
maintenance_customer_id = #{maintenanceCustomerId,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
- <if test="maintenanceIdRepair != null" >
|
|
|
- maintenance_id_repair = #{maintenanceIdRepair,jdbcType=INTEGER},
|
|
|
+ <if test="maintenanceIsRepair != null" >
|
|
|
+ maintenance_is_repair = #{maintenanceIsRepair,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
<if test="maintenanceContentDate != null" >
|
|
|
maintenance_content_date = #{maintenanceContentDate,jdbcType=TIMESTAMP},
|
|
@@ -128,6 +183,15 @@
|
|
|
<if test="maintenanceUpdateTime != null" >
|
|
|
maintenance_update_time = #{maintenanceUpdateTime,jdbcType=TIMESTAMP},
|
|
|
</if>
|
|
|
+ <if test="maintenanceIsWarehousing != null" >
|
|
|
+ maintenance_is_warehousing = #{maintenanceIsWarehousing,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="maintenanceDesc != null" >
|
|
|
+ maintenance_desc = #{maintenanceDesc,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="productColorId != null" >
|
|
|
+ product_color_id = #{productColorId,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
</set>
|
|
|
where maintenance_id = #{maintenanceId,jdbcType=INTEGER}
|
|
|
</update>
|