保盛仓库管理系统后台程序管理
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

TranspoMapper.xml 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3. <mapper namespace="com.th.demo.mapping.maint.TransportMapper" >
  4. <resultMap id="BaseResultMap" type="com.th.demo.model.maint.Transport" >
  5. <id column="id" property="id" jdbcType="VARCHAR" />
  6. <result column="name" property="name" jdbcType="VARCHAR" />
  7. <result column="cancel_flag" property="cancelFlag" jdbcType="VARCHAR" />
  8. <result column="belong_id" property="belongId" jdbcType="VARCHAR" />
  9. </resultMap>
  10. <sql id="Base_Column_List" >
  11. id, name, cancel_flag, belong_id
  12. </sql>
  13. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
  14. select
  15. <include refid="Base_Column_List" />
  16. from t_maint_transport
  17. where id = #{id,jdbcType=VARCHAR}
  18. </select>
  19. <update id="deleteByPrimaryKey" parameterType="java.lang.String" >
  20. update t_maint_transport set cancel_flag = '9'
  21. where id = #{id,jdbcType=VARCHAR}
  22. </update>
  23. <insert id="insert" parameterType="com.th.demo.model.maint.Transport" >
  24. <selectKey keyProperty="id" order="BEFORE" resultType="java.lang.String">
  25. SELECT REPLACE(UUID(),'-','') as id from dual
  26. </selectKey>
  27. insert into t_maint_transport (id, name, cancel_flag, belong_id)
  28. values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
  29. #{cancelFlag,jdbcType=VARCHAR}, #{belongId,jdbcType=VARCHAR})
  30. </insert>
  31. <update id="updateByPrimaryKey" parameterType="com.th.demo.model.maint.Customer" >
  32. update t_maint_transport
  33. set name = #{name,jdbcType=VARCHAR}
  34. where id = #{id,jdbcType=VARCHAR}
  35. </update>
  36. <select id="selectByName" resultMap="BaseResultMap" >
  37. select *
  38. from t_maint_transport
  39. where
  40. ifnull(cancel_flag,'0') = '0'
  41. <if test="param2!=null and param2!=''">
  42. and belong_id = #{param2,jdbcType=VARCHAR}
  43. </if>
  44. <if test="param1!=null and param1!= ''">
  45. and name like concat('%',#{param1,jdbcType=VARCHAR},'%')
  46. </if>
  47. </select>
  48. </mapper>