SupplierV1ServiceDaoImplMapper.xml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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="supplierV1ServiceDaoImpl">
  6. <!-- 保存供应商信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveSupplierInfo" parameterType="Map">
  8. insert into supplier(
  9. supplier_name,person_name,supplier_id,st_id,bean_name,start_time,remark,end_time,person_tel
  10. ) values (
  11. #{supplierName},#{personName},#{supplierId},#{stId},#{beanName},#{startTime},#{remark},#{endTime},#{personTel}
  12. )
  13. </insert>
  14. <!-- 查询供应商信息 add by wuxw 2018-07-03 -->
  15. <select id="getSupplierInfo" parameterType="Map" resultType="Map">
  16. select t.supplier_name,t.supplier_name supplierName,t.person_name,t.person_name personName,t.supplier_id,t.supplier_id supplierId,t.st_id,t.st_id stId,t.bean_name,t.bean_name beanName,t.start_time,t.start_time startTime,t.status_cd,t.status_cd statusCd,t.remark,t.end_time,t.end_time endTime,t.person_tel,t.person_tel personTel
  17. from supplier t
  18. where 1 =1
  19. <if test="supplierName !=null and supplierName != ''">
  20. and t.supplier_name= #{supplierName}
  21. </if>
  22. <if test="personName !=null and personName != ''">
  23. and t.person_name= #{personName}
  24. </if>
  25. <if test="supplierId !=null and supplierId != ''">
  26. and t.supplier_id= #{supplierId}
  27. </if>
  28. <if test="stId !=null and stId != ''">
  29. and t.st_id= #{stId}
  30. </if>
  31. <if test="beanName !=null and beanName != ''">
  32. and t.bean_name= #{beanName}
  33. </if>
  34. <if test="startTime !=null and startTime != ''">
  35. and t.start_time= #{startTime}
  36. </if>
  37. <if test="statusCd !=null and statusCd != ''">
  38. and t.status_cd= #{statusCd}
  39. </if>
  40. <if test="remark !=null and remark != ''">
  41. and t.remark= #{remark}
  42. </if>
  43. <if test="endTime !=null and endTime != ''">
  44. and t.end_time= #{endTime}
  45. </if>
  46. <if test="personTel !=null and personTel != ''">
  47. and t.person_tel= #{personTel}
  48. </if>
  49. order by t.create_time desc
  50. <if test="page != -1 and page != null ">
  51. limit #{page}, #{row}
  52. </if>
  53. </select>
  54. <!-- 修改供应商信息 add by wuxw 2018-07-03 -->
  55. <update id="updateSupplierInfo" parameterType="Map">
  56. update supplier t set t.status_cd = #{statusCd}
  57. <if test="newBId != null and newBId != ''">
  58. ,t.b_id = #{newBId}
  59. </if>
  60. <if test="supplierName !=null and supplierName != ''">
  61. , t.supplier_name= #{supplierName}
  62. </if>
  63. <if test="personName !=null and personName != ''">
  64. , t.person_name= #{personName}
  65. </if>
  66. <if test="stId !=null and stId != ''">
  67. , t.st_id= #{stId}
  68. </if>
  69. <if test="beanName !=null and beanName != ''">
  70. , t.bean_name= #{beanName}
  71. </if>
  72. <if test="startTime !=null and startTime != ''">
  73. , t.start_time= #{startTime}
  74. </if>
  75. <if test="remark !=null and remark != ''">
  76. , t.remark= #{remark}
  77. </if>
  78. <if test="endTime !=null and endTime != ''">
  79. , t.end_time= #{endTime}
  80. </if>
  81. <if test="personTel !=null and personTel != ''">
  82. , t.person_tel= #{personTel}
  83. </if>
  84. where 1=1 <if test="supplierId !=null and supplierId != ''">
  85. and t.supplier_id= #{supplierId}
  86. </if>
  87. </update>
  88. <!-- 查询供应商数量 add by wuxw 2018-07-03 -->
  89. <select id="querySuppliersCount" parameterType="Map" resultType="Map">
  90. select count(1) count
  91. from supplier t
  92. where 1 =1
  93. <if test="supplierName !=null and supplierName != ''">
  94. and t.supplier_name= #{supplierName}
  95. </if>
  96. <if test="personName !=null and personName != ''">
  97. and t.person_name= #{personName}
  98. </if>
  99. <if test="supplierId !=null and supplierId != ''">
  100. and t.supplier_id= #{supplierId}
  101. </if>
  102. <if test="stId !=null and stId != ''">
  103. and t.st_id= #{stId}
  104. </if>
  105. <if test="beanName !=null and beanName != ''">
  106. and t.bean_name= #{beanName}
  107. </if>
  108. <if test="startTime !=null and startTime != ''">
  109. and t.start_time= #{startTime}
  110. </if>
  111. <if test="statusCd !=null and statusCd != ''">
  112. and t.status_cd= #{statusCd}
  113. </if>
  114. <if test="remark !=null and remark != ''">
  115. and t.remark= #{remark}
  116. </if>
  117. <if test="endTime !=null and endTime != ''">
  118. and t.end_time= #{endTime}
  119. </if>
  120. <if test="personTel !=null and personTel != ''">
  121. and t.person_tel= #{personTel}
  122. </if>
  123. </select>
  124. </mapper>