|
@@ -22,7 +22,35 @@ public interface FsCompetitorInfoMapper {
|
|
|
* 查询所有竞品信息
|
|
|
* @return 竞品信息列表
|
|
|
*/
|
|
|
- @Select("SELECT * FROM fs_competitor_info")
|
|
|
+ @Select("<script>" +
|
|
|
+ "SELECT * FROM fs_competitor_info " +
|
|
|
+ "WHERE 1=1 " +
|
|
|
+ "<if test='competitorCompany != null and competitorCompany != \"\"'>" +
|
|
|
+ "AND competitor_company LIKE CONCAT('%', #{competitorCompany}, '%') " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test='product != null and product != \"\"'>" +
|
|
|
+ "AND product LIKE CONCAT('%', #{product}, '%') " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test='price != null'>" +
|
|
|
+ "AND price = #{price} " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test='service != null and service != \"\"'>" +
|
|
|
+ "AND service LIKE CONCAT('%', #{service}, '%') " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test='freeServiceTimes != null'>" +
|
|
|
+ "AND free_service_times = #{freeServiceTimes} " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test='remark != null and remark != \"\"'>" +
|
|
|
+ "AND remark LIKE CONCAT('%', #{remark}, '%') " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test='userId != null'>" +
|
|
|
+ "AND create_by = #{userId} " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test='companyUserId != null'>" +
|
|
|
+ "AND company_user_id = #{companyUserId} " +
|
|
|
+ "</if>" +
|
|
|
+ "ORDER BY create_time DESC" +
|
|
|
+ "</script>")
|
|
|
List<FsCompetitorInfo> selectAll(FsCompetitorInfoParam param);
|
|
|
|
|
|
/**
|
|
@@ -31,9 +59,9 @@ public interface FsCompetitorInfoMapper {
|
|
|
* @return 影响行数
|
|
|
*/
|
|
|
@Insert("INSERT INTO fs_competitor_info (competitor_company, product, price, service, " +
|
|
|
- "free_service_times, remark, create_by, update_by) " +
|
|
|
+ "free_service_times, remark, create_by, update_by, user_id, company_user_id) " +
|
|
|
"VALUES (#{competitorCompany}, #{product}, #{price}, #{service}, " +
|
|
|
- "#{freeServiceTimes}, #{remark}, #{createBy}, #{updateBy})")
|
|
|
+ "#{freeServiceTimes}, #{remark}, #{createBy}, #{updateBy}, #{userId}, #{companyUserId})")
|
|
|
@Options(useGeneratedKeys = true, keyProperty = "id")
|
|
|
int insert(FsCompetitorInfo FsCompetitorInfo);
|
|
|
|
|
@@ -42,10 +70,20 @@ public interface FsCompetitorInfoMapper {
|
|
|
* @param FsCompetitorInfo 竞品信息
|
|
|
* @return 影响行数
|
|
|
*/
|
|
|
- @Update("UPDATE fs_competitor_info SET competitor_company = #{competitorCompany}, product = #{product}, " +
|
|
|
- "price = #{price}, service = #{service}, free_service_times = #{freeServiceTimes}, " +
|
|
|
- "remark = #{remark}, update_by = #{updateBy} " +
|
|
|
- "WHERE id = #{id}")
|
|
|
+ @Update("<script>" +
|
|
|
+ "UPDATE fs_competitor_info SET " +
|
|
|
+ "<if test='competitorCompany != null'>competitor_company = #{competitorCompany}, </if>" +
|
|
|
+ "<if test='product != null'>product = #{product}, </if>" +
|
|
|
+ "<if test='price != null'>price = #{price}, </if>" +
|
|
|
+ "<if test='service != null'>service = #{service}, </if>" +
|
|
|
+ "<if test='freeServiceTimes != null'>free_service_times = #{freeServiceTimes}, </if>" +
|
|
|
+ "<if test='remark != null'>remark = #{remark}, </if>" +
|
|
|
+ "<if test='updateBy != null'>update_by = #{updateBy}, </if>" +
|
|
|
+ "<if test='userId != null'>user_id = #{userId}, </if>" +
|
|
|
+ "<if test='companyUserId != null'>company_user_id = #{companyUserId}, </if>" +
|
|
|
+ "update_time = NOW() " +
|
|
|
+ "WHERE id = #{id}" +
|
|
|
+ "</script>")
|
|
|
int update(FsCompetitorInfo FsCompetitorInfo);
|
|
|
|
|
|
/**
|