TFeesMapper.xml 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  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.ruoyi.basicData.mapper.TFeesMapper">
  6. <resultMap type="TFees" id="TFeesResult">
  7. <result property="fId" column="f_id"/>
  8. <result property="fNo" column="f_no"/>
  9. <result property="fName" column="f_name"/>
  10. <result property="fFeetype" column="f_feetype"/>
  11. <result property="fFeeunitid" column="f_feeunitid"/>
  12. <result property="fCurrency" column="f_currency"/>
  13. <result property="fStatus" column="f_status"/>
  14. <result property="delFlag" column="del_flag"/>
  15. <result property="createBy" column="create_by"/>
  16. <result property="createTime" column="create_time"/>
  17. <result property="updateBy" column="update_by"/>
  18. <result property="updateTime" column="update_time"/>
  19. <result property="remark" column="remark"/>
  20. <result property="fDc" column="f_dc"/>
  21. <result property="isModify" column="is_modify"/>
  22. <result property="fTaxSort" column="f_tax_sort"/>
  23. <result property="fTaxCode" column="f_tax_code"/>
  24. <result property="fTaxRate" column="f_tax_rate"/>
  25. <result property="fTaxTag" column="f_tax_tag"/>
  26. <result property="fDiscounts" column="f_discounts"/>
  27. </resultMap>
  28. <sql id="selectTFeesVo">
  29. select f_id,
  30. f_no,
  31. f_name,
  32. f_feetype,
  33. f_feeunitid,
  34. f_currency,
  35. f_status,
  36. del_flag,
  37. create_by,
  38. create_time,
  39. update_by,
  40. update_time,
  41. remark,
  42. f_dc,
  43. is_modify,
  44. f_tax_sort,
  45. f_tax_code,
  46. f_tax_rate,
  47. f_tax_tag,
  48. f_discounts,
  49. case when f_discounts = '0' then '是' else '否' end as fDiscountsName
  50. from t_fees
  51. </sql>
  52. <select id="selectTFeesList" parameterType="TFees" resultMap="TFeesResult">
  53. <include refid="selectTFeesVo"/>
  54. <where>
  55. <if test="fNo != null and fNo != ''">and f_no like concat('%', #{fNo}, '%')</if>
  56. <if test="fName != null and fName != ''">and f_name like concat('%', #{fName}, '%')</if>
  57. <if test="fFeetype != null and fFeetype != ''">and f_feetype = #{fFeetype}</if>
  58. <if test="fFeeunitid != null ">and f_feeunitid = #{fFeeunitid}</if>
  59. <if test="isModify != null and isModify != ''">and is_modify = #{isModify}</if>
  60. <if test="fCurrency != null and fCurrency != ''">and f_currency like concat('%', #{fCurrency}, '%')</if>
  61. <if test="fStatus != null and fStatus != ''">and f_status = #{fStatus}</if>
  62. <if test="fDc != null and fDc != ''">and f_dc like concat('%', #{fDc}, '%')</if>
  63. </where>
  64. ORDER BY CONVERT(f_name USING gbk) asc
  65. </select>
  66. <select id="selectTFeesById" parameterType="Long" resultMap="TFeesResult">
  67. <include refid="selectTFeesVo"/>
  68. where f_id = #{fId}
  69. </select>
  70. <select id="selectTFeesModify" parameterType="TFees" resultType="String">
  71. select is_modify
  72. from t_fees
  73. where f_id = #{fId}
  74. </select>
  75. <insert id="insertTFees" parameterType="TFees" useGeneratedKeys="true" keyProperty="fId">
  76. insert into t_fees
  77. <trim prefix="(" suffix=")" suffixOverrides=",">
  78. <if test="fNo != null and fNo != ''">f_no,</if>
  79. <if test="fName != null and fName != ''">f_name,</if>
  80. <if test="fFeetype != null">f_feetype,</if>
  81. <if test="fFeeunitid != null">f_feeunitid,</if>
  82. <if test="fCurrency != null">f_currency,</if>
  83. <if test="fStatus != null">f_status,</if>
  84. <if test="delFlag != null">del_flag,</if>
  85. <if test="createBy != null">create_by,</if>
  86. <if test="createTime != null">create_time,</if>
  87. <if test="updateBy != null">update_by,</if>
  88. <if test="updateTime != null">update_time,</if>
  89. <if test="remark != null">remark,</if>
  90. <if test="fDc != null">f_dc,</if>
  91. <if test="isModify != null">is_modify,</if>
  92. <if test="fTaxSort != null">f_tax_sort,</if>
  93. <if test="fTaxCode != null">f_tax_code,</if>
  94. <if test="fTaxRate != null">f_tax_rate,</if>
  95. <if test="fTaxTag != null">f_tax_tag,</if>
  96. <if test="fDiscounts != null">f_discounts,</if>
  97. </trim>
  98. <trim prefix="values (" suffix=")" suffixOverrides=",">
  99. <if test="fNo != null and fNo != ''">#{fNo},</if>
  100. <if test="fName != null and fName != ''">#{fName},</if>
  101. <if test="fFeetype != null">#{fFeetype},</if>
  102. <if test="fFeeunitid != null">#{fFeeunitid},</if>
  103. <if test="fCurrency != null">#{fCurrency},</if>
  104. <if test="fStatus != null">#{fStatus},</if>
  105. <if test="delFlag != null">#{delFlag},</if>
  106. <if test="createBy != null">#{createBy},</if>
  107. <if test="createTime != null">#{createTime},</if>
  108. <if test="updateBy != null">#{updateBy},</if>
  109. <if test="updateTime != null">#{updateTime},</if>
  110. <if test="remark != null">#{remark},</if>
  111. <if test="fDc != null">#{fDc},</if>
  112. <if test="isModify != null">#{isModify},</if>
  113. <if test="fTaxSort != null">#{fTaxSort},</if>
  114. <if test="fTaxCode != null">#{fTaxCode},</if>
  115. <if test="fTaxRate != null">#{fTaxRate},</if>
  116. <if test="fTaxTag != null">#{fTaxTag},</if>
  117. <if test="fDiscounts != null">#{fDiscounts},</if>
  118. </trim>
  119. </insert>
  120. <update id="updateTFees" parameterType="TFees">
  121. update t_fees
  122. <trim prefix="SET" suffixOverrides=",">
  123. <if test="fNo != null and fNo != ''">f_no = #{fNo},</if>
  124. <if test="fName != null and fName != ''">f_name = #{fName},</if>
  125. <if test="fFeetype != null">f_feetype = #{fFeetype},</if>
  126. <if test="fFeeunitid != null">f_feeunitid = #{fFeeunitid},</if>
  127. <if test="fCurrency != null">f_currency = #{fCurrency},</if>
  128. <if test="fStatus != null">f_status = #{fStatus},</if>
  129. <if test="delFlag != null">del_flag = #{delFlag},</if>
  130. <if test="createBy != null">create_by = #{createBy},</if>
  131. <if test="createTime != null">create_time = #{createTime},</if>
  132. <if test="updateBy != null">update_by = #{updateBy},</if>
  133. <if test="updateTime != null">update_time = #{updateTime},</if>
  134. <if test="remark != null">remark = #{remark},</if>
  135. <if test="fDc != null">f_dc = #{fDc},</if>
  136. <if test="isModify != null">is_modify = #{isModify},</if>
  137. <if test="fTaxSort != null">f_tax_sort = #{fTaxSort},</if>
  138. <if test="fTaxCode != null">f_tax_code = #{fTaxCode},</if>
  139. <if test="fTaxRate != null">f_tax_rate = #{fTaxRate},</if>
  140. <if test="fTaxTag != null">f_tax_tag = #{fTaxTag},</if>
  141. <if test="fDiscounts != null">f_discounts = #{fDiscounts},</if>
  142. </trim>
  143. where f_id = #{fId}
  144. </update>
  145. <delete id="deleteTFeesById" parameterType="Long">
  146. delete
  147. from t_fees
  148. where f_id = #{fId}
  149. </delete>
  150. <delete id="deleteTFeesByIds" parameterType="String">
  151. delete from t_fees where f_id in
  152. <foreach item="fId" collection="array" open="(" separator="," close=")">
  153. #{fId}
  154. </foreach>
  155. </delete>
  156. <select id="checkFNoUnique" parameterType="String" resultMap="TFeesResult">
  157. select f_id, f_no
  158. from t_fees
  159. where f_no = #{fNo}
  160. limit 1
  161. </select>
  162. <select id="checkUFNnameUnique" parameterType="String" resultMap="TFeesResult">
  163. select f_id, f_name
  164. from t_fees
  165. where f_name = #{fAame}
  166. limit 1
  167. </select>
  168. <select id="selectTFeesByFName" parameterType="string" resultMap="TFeesResult">
  169. select f_id, f_name
  170. from t_fees
  171. where f_name = #{fAame}
  172. </select>
  173. </mapper>