CompanyDetectionPhoneDailyStatisticsMapper.xml 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.fs.company.mapper.CompanyDetectionPhoneDailyStatisticsMapper">
  6. <resultMap type="CompanyDetectionPhoneDailyStatistics" id="CompanyDetectionPhoneDailyStatisticsResult">
  7. <result property="id" column="id" />
  8. <result property="companyId" column="company_id" />
  9. <result property="companyName" column="company_name" />
  10. <result property="companyUserId" column="company_user_id" />
  11. <result property="companyUserName" column="company_user_name" />
  12. <result property="detectionTime" column="detection_time" />
  13. <result property="azCount" column="az_count" />
  14. <result property="iosCount" column="ios_count" />
  15. <result property="unknownCount" column="unknown_count" />
  16. <result property="totalCount" column="total_count" />
  17. <result property="createTime" column="create_time" />
  18. </resultMap>
  19. <sql id="selectCompanyDetectionPhoneDailyStatisticsVo">
  20. select id, company_id, company_name, company_user_id, company_user_name, detection_time, az_count, ios_count, unknown_count, total_count, create_time from company_detection_phone_daily_statistics
  21. </sql>
  22. <select id="selectCompanyDetectionPhoneDailyStatisticsList" parameterType="CompanyDetectionPhoneDailyStatistics" resultMap="CompanyDetectionPhoneDailyStatisticsResult">
  23. <include refid="selectCompanyDetectionPhoneDailyStatisticsVo"/>
  24. <where>
  25. <if test="companyId != null "> and company_id = #{companyId}</if>
  26. <if test="companyName != null and companyName != ''"> and company_name like concat('%', #{companyName}, '%')</if>
  27. <if test="companyUserId != null "> and company_user_id = #{companyUserId}</if>
  28. <if test="companyUserName != null and companyUserName != ''"> and company_user_name like concat('%', #{companyUserName}, '%')</if>
  29. <if test="detectionTime != null "> and DATE(detection_time) = DATE(#{detectionTime})</if>
  30. <if test="azCount != null "> and az_count = #{azCount}</if>
  31. <if test="iosCount != null "> and ios_count = #{iosCount}</if>
  32. <if test="unknownCount != null "> and unknown_count = #{unknownCount}</if>
  33. <if test="totalCount != null "> and total_count = #{totalCount}</if>
  34. </where>
  35. order by id desc
  36. </select>
  37. <select id="selectCompanyDetectionPhoneDailyStatisticsById" parameterType="Long" resultMap="CompanyDetectionPhoneDailyStatisticsResult">
  38. <include refid="selectCompanyDetectionPhoneDailyStatisticsVo"/>
  39. where id = #{id}
  40. </select>
  41. <insert id="insertCompanyDetectionPhoneDailyStatistics" parameterType="CompanyDetectionPhoneDailyStatistics" useGeneratedKeys="true" keyProperty="id">
  42. insert into company_detection_phone_daily_statistics
  43. <trim prefix="(" suffix=")" suffixOverrides=",">
  44. <if test="companyId != null">company_id,</if>
  45. <if test="companyName != null">company_name,</if>
  46. <if test="companyUserId != null">company_user_id,</if>
  47. <if test="companyUserName != null">company_user_name,</if>
  48. <if test="detectionTime != null">detection_time,</if>
  49. <if test="azCount != null">az_count,</if>
  50. <if test="iosCount != null">ios_count,</if>
  51. <if test="unknownCount != null">unknown_count,</if>
  52. <if test="totalCount != null">total_count,</if>
  53. <if test="createTime != null">create_time,</if>
  54. </trim>
  55. <trim prefix="values (" suffix=")" suffixOverrides=",">
  56. <if test="companyId != null">#{companyId},</if>
  57. <if test="companyName != null">#{companyName},</if>
  58. <if test="companyUserId != null">#{companyUserId},</if>
  59. <if test="companyUserName != null">#{companyUserName},</if>
  60. <if test="detectionTime != null">#{detectionTime},</if>
  61. <if test="azCount != null">#{azCount},</if>
  62. <if test="iosCount != null">#{iosCount},</if>
  63. <if test="unknownCount != null">#{unknownCount},</if>
  64. <if test="totalCount != null">#{totalCount},</if>
  65. <if test="createTime != null">#{createTime},</if>
  66. </trim>
  67. </insert>
  68. <update id="updateCompanyDetectionPhoneDailyStatistics" parameterType="CompanyDetectionPhoneDailyStatistics">
  69. update company_detection_phone_daily_statistics
  70. <trim prefix="SET" suffixOverrides=",">
  71. <if test="companyId != null">company_id = #{companyId},</if>
  72. <if test="companyName != null">company_name = #{companyName},</if>
  73. <if test="companyUserId != null">company_user_id = #{companyUserId},</if>
  74. <if test="companyUserName != null">company_user_name = #{companyUserName},</if>
  75. <if test="detectionTime != null">detection_time = #{detectionTime},</if>
  76. <if test="azCount != null">az_count = #{azCount},</if>
  77. <if test="iosCount != null">ios_count = #{iosCount},</if>
  78. <if test="unknownCount != null">unknown_count = #{unknownCount},</if>
  79. <if test="totalCount != null">total_count = #{totalCount},</if>
  80. <if test="createTime != null">create_time = #{createTime},</if>
  81. </trim>
  82. where id = #{id}
  83. </update>
  84. <delete id="deleteCompanyDetectionPhoneDailyStatisticsById" parameterType="Long">
  85. delete from company_detection_phone_daily_statistics where id = #{id}
  86. </delete>
  87. <delete id="deleteCompanyDetectionPhoneDailyStatisticsByIds" parameterType="String">
  88. delete from company_detection_phone_daily_statistics where id in
  89. <foreach item="id" collection="array" open="(" separator="," close=")">
  90. #{id}
  91. </foreach>
  92. </delete>
  93. </mapper>