CompanyProfitMapper.xml 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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.CompanyProfitMapper">
  6. <resultMap type="CompanyProfit" id="CompanyProfitResult">
  7. <result property="profitId" column="profit_id" />
  8. <result property="companyId" column="company_id" />
  9. <result property="bankName" column="bank_name" />
  10. <result property="bankBranchName" column="bank_branch_name" />
  11. <result property="bankCardNo" column="bank_card_no" />
  12. <result property="bankUserName" column="bank_user_name" />
  13. <result property="money" column="money" />
  14. <result property="balances" column="balances" />
  15. <result property="profitStatus" column="profit_status" />
  16. <result property="profitType" column="profit_type" />
  17. <result property="remark" column="remark" />
  18. <result property="createTime" column="create_time" />
  19. <result property="updateTime" column="update_time" />
  20. <result property="imgUrl" column="img_url" />
  21. </resultMap>
  22. <sql id="selectCompanyProfitVo">
  23. select profit_id, company_id, bank_name, bank_branch_name, bank_card_no, bank_user_name, money, balances, profit_status, profit_type, remark, create_time, update_time,img_url from company_profit
  24. </sql>
  25. <select id="selectCompanyProfitList" parameterType="CompanyProfit" resultMap="CompanyProfitResult">
  26. <include refid="selectCompanyProfitVo"/>
  27. <where>
  28. <if test="companyId != null "> and company_id = #{companyId}</if>
  29. <if test="bankName != null and bankName != ''"> and bank_name like concat('%', #{bankName}, '%')</if>
  30. <if test="bankBranchName != null and bankBranchName != ''"> and bank_branch_name like concat('%', #{bankBranchName}, '%')</if>
  31. <if test="bankCardNo != null and bankCardNo != ''"> and bank_card_no = #{bankCardNo}</if>
  32. <if test="bankUserName != null and bankUserName != ''"> and bank_user_name like concat('%', #{bankUserName}, '%')</if>
  33. <if test="money != null "> and money = #{money}</if>
  34. <if test="balances != null "> and balances = #{balances}</if>
  35. <if test="profitStatus != null "> and profit_status = #{profitStatus}</if>
  36. <if test="profitType != null "> and profit_type = #{profitType}</if>
  37. </where>
  38. </select>
  39. <select id="selectCompanyProfitById" parameterType="Long" resultMap="CompanyProfitResult">
  40. <include refid="selectCompanyProfitVo"/>
  41. where profit_id = #{profitId}
  42. </select>
  43. <insert id="insertCompanyProfit" parameterType="CompanyProfit" useGeneratedKeys="true" keyProperty="profitId">
  44. insert into company_profit
  45. <trim prefix="(" suffix=")" suffixOverrides=",">
  46. <if test="companyId != null">company_id,</if>
  47. <if test="bankName != null">bank_name,</if>
  48. <if test="bankBranchName != null">bank_branch_name,</if>
  49. <if test="bankCardNo != null">bank_card_no,</if>
  50. <if test="bankUserName != null">bank_user_name,</if>
  51. <if test="money != null">money,</if>
  52. <if test="balances != null">balances,</if>
  53. <if test="profitStatus != null">profit_status,</if>
  54. <if test="profitType != null">profit_type,</if>
  55. <if test="remark != null">remark,</if>
  56. <if test="createTime != null">create_time,</if>
  57. <if test="updateTime != null">update_time,</if>
  58. <if test="imgUrl != null">img_url,</if>
  59. </trim>
  60. <trim prefix="values (" suffix=")" suffixOverrides=",">
  61. <if test="companyId != null">#{companyId},</if>
  62. <if test="bankName != null">#{bankName},</if>
  63. <if test="bankBranchName != null">#{bankBranchName},</if>
  64. <if test="bankCardNo != null">#{bankCardNo},</if>
  65. <if test="bankUserName != null">#{bankUserName},</if>
  66. <if test="money != null">#{money},</if>
  67. <if test="balances != null">#{balances},</if>
  68. <if test="profitStatus != null">#{profitStatus},</if>
  69. <if test="profitType != null">#{profitType},</if>
  70. <if test="remark != null">#{remark},</if>
  71. <if test="createTime != null">#{createTime},</if>
  72. <if test="updateTime != null">#{updateTime},</if>
  73. <if test="imgUrl != null">#{imgUrl},</if>
  74. </trim>
  75. </insert>
  76. <update id="updateCompanyProfit" parameterType="CompanyProfit">
  77. update company_profit
  78. <trim prefix="SET" suffixOverrides=",">
  79. <if test="companyId != null">company_id = #{companyId},</if>
  80. <if test="bankName != null">bank_name = #{bankName},</if>
  81. <if test="bankBranchName != null">bank_branch_name = #{bankBranchName},</if>
  82. <if test="bankCardNo != null">bank_card_no = #{bankCardNo},</if>
  83. <if test="bankUserName != null">bank_user_name = #{bankUserName},</if>
  84. <if test="money != null">money = #{money},</if>
  85. <if test="balances != null">balances = #{balances},</if>
  86. <if test="profitStatus != null">profit_status = #{profitStatus},</if>
  87. <if test="profitType != null">profit_type = #{profitType},</if>
  88. <if test="remark != null">remark = #{remark},</if>
  89. <if test="createTime != null">create_time = #{createTime},</if>
  90. <if test="updateTime != null">update_time = #{updateTime},</if>
  91. <if test="imgUrl != null">img_url = #{imgUrl},</if>
  92. </trim>
  93. where profit_id = #{profitId}
  94. </update>
  95. <delete id="deleteCompanyProfitById" parameterType="Long">
  96. delete from company_profit where profit_id = #{profitId}
  97. </delete>
  98. <delete id="deleteCompanyProfitByIds" parameterType="String">
  99. delete from company_profit where profit_id in
  100. <foreach item="profitId" collection="array" open="(" separator="," close=")">
  101. #{profitId}
  102. </foreach>
  103. </delete>
  104. </mapper>