|
@@ -39,8 +39,8 @@ public interface FsComplaintMapper {
|
|
|
/**
|
|
|
* 插入投诉信息
|
|
|
*/
|
|
|
- @Insert("INSERT INTO fs_complaint(complaint_no, category_id, content, contact_phone, contact_email, status, create_time, update_time) " +
|
|
|
- "VALUES(#{complaintNo}, #{categoryId}, #{content}, #{contactPhone}, #{contactEmail}, #{status}, #{createTime}, #{updateTime})")
|
|
|
+ @Insert("INSERT INTO fs_complaint(complaint_no, category_id, category_name, content, contact_phone, contact_email, status, create_time, update_time) " +
|
|
|
+ "VALUES(#{complaintNo}, #{categoryId}, #{categoryName}, #{content}, #{contactPhone}, #{contactEmail}, #{status}, #{createTime}, #{updateTime})")
|
|
|
@Options(useGeneratedKeys = true, keyProperty = "id")
|
|
|
int insert(FsComplaint complaint);
|
|
|
|
|
@@ -77,6 +77,9 @@ public interface FsComplaintMapper {
|
|
|
if (complaint.getCategoryId() != null) {
|
|
|
sql.append(", category_id = #{categoryId}");
|
|
|
}
|
|
|
+ if (complaint.getCategoryName() != null) {
|
|
|
+ sql.append(", category_name = #{categoryName}");
|
|
|
+ }
|
|
|
if (complaint.getContent() != null) {
|
|
|
sql.append(", content = #{content}");
|
|
|
}
|
|
@@ -104,6 +107,9 @@ public interface FsComplaintMapper {
|
|
|
if (queryDTO.getCategoryId() != null) {
|
|
|
where.append(" AND category_id = #{categoryId}");
|
|
|
}
|
|
|
+ if (queryDTO.getCategoryName() != null && !queryDTO.getCategoryName().trim().isEmpty()) {
|
|
|
+ where.append(" AND category_name LIKE CONCAT('%', #{categoryName}, '%')");
|
|
|
+ }
|
|
|
if (queryDTO.getStatus() != null) {
|
|
|
where.append(" AND status = #{status}");
|
|
|
}
|