TCompanyMapper.xml 4.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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.TCompanyMapper">
  6. <resultMap type="TCompany" id="TCompanyResult">
  7. <result property="fId" column="f_id"/>
  8. <result property="fNo" column="f_no"/>
  9. <result property="fName" column="f_name"/>
  10. <result property="fStatus" column="f_status"/>
  11. <result property="delFlag" column="del_flag"/>
  12. <result property="createBy" column="create_by"/>
  13. <result property="createTime" column="create_time"/>
  14. <result property="updateBy" column="update_by"/>
  15. <result property="updateTime" column="update_time"/>
  16. <result property="remark" column="remark"/>
  17. </resultMap>
  18. <sql id="selectTCompanyVo">
  19. select f_id, f_no, f_name, f_status, del_flag, create_by, create_time, update_by, update_time, remark from t_company
  20. </sql>
  21. <select id="selectTCompanyList" parameterType="TCompany" resultMap="TCompanyResult">
  22. <include refid="selectTCompanyVo"/>
  23. <where>
  24. <if test="fNo != null and fNo != ''">and f_no = #{fNo}</if>
  25. <if test="fName != null and fName != ''">and f_name like concat('%', #{fName}, '%')</if>
  26. <if test="fStatus != null and fStatus != ''">and f_status = #{fStatus}</if>
  27. </where>
  28. </select>
  29. <select id="selectTCompanyById" parameterType="Long" resultMap="TCompanyResult">
  30. <include refid="selectTCompanyVo"/>
  31. where f_id = #{fId}
  32. </select>
  33. <insert id="insertTCompany" parameterType="TCompany" useGeneratedKeys="true" keyProperty="fId">
  34. insert into t_company
  35. <trim prefix="(" suffix=")" suffixOverrides=",">
  36. <if test="fNo != null and fNo != ''">f_no,</if>
  37. <if test="fName != null and fName != ''">f_name,</if>
  38. <if test="fStatus != null">f_status,</if>
  39. <if test="delFlag != null">del_flag,</if>
  40. <if test="createBy != null">create_by,</if>
  41. <if test="createTime != null">create_time,</if>
  42. <if test="updateBy != null">update_by,</if>
  43. <if test="updateTime != null">update_time,</if>
  44. <if test="remark != null">remark,</if>
  45. </trim>
  46. <trim prefix="values (" suffix=")" suffixOverrides=",">
  47. <if test="fNo != null and fNo != ''">#{fNo},</if>
  48. <if test="fName != null and fName != ''">#{fName},</if>
  49. <if test="fStatus != null">#{fStatus},</if>
  50. <if test="delFlag != null">#{delFlag},</if>
  51. <if test="createBy != null">#{createBy},</if>
  52. <if test="createTime != null">#{createTime},</if>
  53. <if test="updateBy != null">#{updateBy},</if>
  54. <if test="updateTime != null">#{updateTime},</if>
  55. <if test="remark != null">#{remark},</if>
  56. </trim>
  57. </insert>
  58. <update id="updateTCompany" parameterType="TCompany">
  59. update t_company
  60. <trim prefix="SET" suffixOverrides=",">
  61. <if test="fNo != null and fNo != ''">f_no = #{fNo},</if>
  62. <if test="fName != null and fName != ''">f_name = #{fName},</if>
  63. <if test="fStatus != null">f_status = #{fStatus},</if>
  64. <if test="delFlag != null">del_flag = #{delFlag},</if>
  65. <if test="createBy != null">create_by = #{createBy},</if>
  66. <if test="createTime != null">create_time = #{createTime},</if>
  67. <if test="updateBy != null">update_by = #{updateBy},</if>
  68. <if test="updateTime != null">update_time = #{updateTime},</if>
  69. <if test="remark != null">remark = #{remark},</if>
  70. </trim>
  71. where f_id = #{fId}
  72. </update>
  73. <delete id="deleteTCompanyById" parameterType="Long">
  74. delete from t_company where f_id = #{fId}
  75. </delete>
  76. <delete id="deleteTCompanyByIds" parameterType="String">
  77. delete from t_company where f_id in
  78. <foreach item="fId" collection="array" open="(" separator="," close=")">
  79. #{fId}
  80. </foreach>
  81. </delete>
  82. </mapper>