CompanyVoiceMobileMapper.xml 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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.CompanyVoiceMobileMapper">
  6. <resultMap type="CompanyVoiceMobile" id="CompanyVoiceMobileResult">
  7. <result property="mobileId" column="mobile_id" />
  8. <result property="apiId" column="api_id" />
  9. <result property="mobile" column="mobile" />
  10. <result property="status" column="status" />
  11. <result property="companyId" column="company_id" />
  12. <result property="mobileType" column="mobile_type" />
  13. <result property="remark" column="remark" />
  14. </resultMap>
  15. <sql id="selectCompanyVoiceMobileVo">
  16. select mobile_id, api_id, mobile, status,company_id,mobile_type,remark from company_voice_mobile
  17. </sql>
  18. <select id="selectCompanyVoiceMobileList" parameterType="CompanyVoiceMobile" resultMap="CompanyVoiceMobileResult">
  19. <include refid="selectCompanyVoiceMobileVo"/>
  20. <where>
  21. <if test="apiId != null "> and api_id = #{apiId}</if>
  22. <if test="mobile != null and mobile != ''"> and mobile = #{mobile}</if>
  23. <if test="status != null "> and status = #{status}</if>
  24. </where>
  25. </select>
  26. <select id="selectCompanyVoiceMobileById" parameterType="Long" resultMap="CompanyVoiceMobileResult">
  27. <include refid="selectCompanyVoiceMobileVo"/>
  28. where mobile_id = #{mobileId}
  29. </select>
  30. <insert id="insertCompanyVoiceMobile" parameterType="CompanyVoiceMobile">
  31. insert into company_voice_mobile
  32. <trim prefix="(" suffix=")" suffixOverrides=",">
  33. <if test="mobileId != null">mobile_id,</if>
  34. <if test="apiId != null">api_id,</if>
  35. <if test="mobile != null">mobile,</if>
  36. <if test="status != null">status,</if>
  37. <if test="companyId != null">company_id,</if>
  38. <if test="mobileType != null">mobile_type,</if>
  39. <if test="remark != null">remark,</if>
  40. </trim>
  41. <trim prefix="values (" suffix=")" suffixOverrides=",">
  42. <if test="mobileId != null">#{mobileId},</if>
  43. <if test="apiId != null">#{apiId},</if>
  44. <if test="mobile != null">#{mobile},</if>
  45. <if test="status != null">#{status},</if>
  46. <if test="companyId != null">#{companyId},</if>
  47. <if test="mobileType != null">#{mobileType},</if>
  48. <if test="remark != null">#{remark},</if>
  49. </trim>
  50. </insert>
  51. <update id="updateCompanyVoiceMobile" parameterType="CompanyVoiceMobile">
  52. update company_voice_mobile
  53. <trim prefix="SET" suffixOverrides=",">
  54. <if test="apiId != null">api_id = #{apiId},</if>
  55. <if test="mobile != null">mobile = #{mobile},</if>
  56. <if test="status != null">status = #{status},</if>
  57. <if test="companyId != null">company_id = #{companyId},</if>
  58. <if test="mobileType != null">mobile_type = #{mobileType},</if>
  59. <if test="remark != null">remark = #{remark},</if>
  60. </trim>
  61. where mobile_id = #{mobileId}
  62. </update>
  63. <delete id="deleteCompanyVoiceMobileById" parameterType="Long">
  64. delete from company_voice_mobile where mobile_id = #{mobileId}
  65. </delete>
  66. <delete id="deleteCompanyVoiceMobileByIds" parameterType="String">
  67. delete from company_voice_mobile where mobile_id in
  68. <foreach item="mobileId" collection="array" open="(" separator="," close=")">
  69. #{mobileId}
  70. </foreach>
  71. </delete>
  72. </mapper>