SupplierMapper.xml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  3. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  4. <mapper namespace="com.travel.mapper.SupplierMapper">
  5. <!-- 修改供应商信息 -->
  6. <update id="upddateSupplier" parameterType="Supplier">
  7. update sys_supplier
  8. <set>
  9. <trim suffixOverrides=",">
  10. <if test="natureSupplier != null and natureSupplier != ''">
  11. nature_supplier = #{natureSupplier},
  12. </if>
  13. <if test="contact != null and contact != ''">
  14. contact = #{contact},
  15. </if>
  16. <if test="name != null and name != ''">
  17. name = #{name},
  18. </if>
  19. <if test="phone != null and phone != ''">
  20. phone = #{phone},
  21. </if>
  22. <if test="language != null and language != ''">
  23. language = #{language},
  24. </if>
  25. <if test="certificateType != null and certificateType != ''">
  26. certificate_type = #{certificateType},
  27. </if>
  28. <if test="headpir != null and headpir != ''">
  29. headpir = #{headpir},
  30. </if>
  31. <if test="flag != null and flag != ''">
  32. flag = #{flag},
  33. </if>
  34. <if test="certificate != null and certificate != ''">
  35. certificate = #{certificate},
  36. </if>
  37. <if test="pass != null and pass != ''">
  38. pass = #{pass},
  39. </if>
  40. </trim>
  41. </set>
  42. where phone=#{phone}
  43. </update>
  44. <!-- 验证手机号 -->
  45. <select id="checkTele" resultType="int">
  46. select count(*) as count from sys_supplier where phone=#{phone}
  47. </select>
  48. <!-- 根据手机号删除用户 -->
  49. <delete id="delUser">
  50. delete from sys_supplier where phone=#{phone}
  51. </delete>
  52. <!-- 新增供应商 -->
  53. <insert id="insetUser" parameterType="Supplier">
  54. INSERT INTO sys_supplier (code,nature_supplier,contact,phone,language,certificate_type,certificate,headpir,jdrq,flag,captcha,invoice,name,offer_num,balance_of)
  55. VALUES(#{code},#{natureSupplier},#{contact},#{phone},#{language},#{certificateType},#{certificate},#{headpir},GETDATE(),0,#{captcha},#{invoice},#{name},0,0)
  56. </insert>
  57. <!-- 修改验证码 -->
  58. <update id="updateCaptcha">
  59. update sys_supplier set captcha=#{captcha} where phone=#{phone}
  60. </update>
  61. <!-- 根据code修改手机号验证码 -->
  62. <update id="updateCaptchaCode">
  63. update sys_supplier set captcha=#{captcha} where code=#{code}
  64. </update>
  65. <!-- 校验验证码 -->
  66. <select id="checkCaptcha" resultType="int">
  67. select count(*) from sys_supplier where phone=#{phone} and captcha=#{captcha}
  68. </select>
  69. <!-- 手机号登录验证是否第一次登录 -->
  70. <select id="checkUser" resultType="Supplier">
  71. select id,code,nature_supplier as natureSupplier,contact,phone,language,certificate_type as certificateType,certificate,headpir,jdrq,flag,captcha,invoice,name
  72. from sys_supplier
  73. where phone=#{phone} and captcha=#{captcha}
  74. </select>
  75. </mapper>