BaseSkuMapper.xml 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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.abi.qms.platform.dao.mapper.BaseSkuMapper">
  4. <!--603版 已作废-->
  5. <!--&lt;!&ndash; 通用查询映射结果 &ndash;&gt;
  6. <resultMap id="BaseResultMap" type="com.abi.qms.platform.dao.entity.BaseSku">
  7. <id column="id" property="id" />
  8. <result column="sku_code" property="skuCode" />
  9. <result column="sku_name" property="skuName" />
  10. <result column="brand_code" property="brandCode" />
  11. <result column="sub_brand_code" property="subBrandCode" />
  12. <result column="valid" property="valid" />
  13. <result column="create_time" property="createTime" />
  14. <result column="create_by" property="createBy" />
  15. <result column="update_time" property="updateTime" />
  16. <result column="update_by" property="updateBy" />
  17. <result column="is_delete" property="isDelete" />
  18. </resultMap>
  19. &lt;!&ndash; 通用查询结果列 &ndash;&gt;
  20. <sql id="Base_Column_List">
  21. id, sku_code, sku_name, brand_code, sub_brand_code, valid, create_time, create_by, update_time, update_by, is_delete
  22. </sql>
  23. <select id="listSku" resultType="com.abi.qms.platform.dao.vo.result.BaseSkuVO">
  24. SELECT
  25. bs.id,
  26. bs.sku_code,
  27. bs.sku_name,
  28. bs.brand_code,
  29. bs.sub_brand_code,
  30. bs.create_time,
  31. bs.create_by,
  32. bs.update_time,
  33. bs.update_by,
  34. bs.valid,
  35. bb.brand_name as brand_name,
  36. bb1.brand_name as sub_brand_name
  37. FROM `base_sku` bs
  38. LEFT JOIN base_brand bb on bs.brand_code = bb.brand_code
  39. LEFT JOIN base_brand bb1 on bs.sub_brand_code = bb1.brand_code
  40. <where>
  41. bs.is_delete = 0
  42. <if test="param.skuName != null and param.skuName != ''">
  43. AND bs.sku_name LIKE CONCAT('%',#{param.skuName},'%')
  44. </if>
  45. <if test="param.brandCode != null">
  46. AND bs.brand_code = #{param.brandCode}
  47. </if>
  48. <if test="param.valid != null">
  49. AND bs.valid = #{param.valid}
  50. </if>
  51. </where>
  52. order by bs.update_time desc
  53. </select>
  54. <select id="selectSkuById" resultType="com.abi.qms.platform.dao.vo.result.BaseSkuVO">
  55. SELECT
  56. bs.id,
  57. bs.sku_code,
  58. bs.sku_name,
  59. bs.brand_code,
  60. bs.sub_brand_code,
  61. bs.create_time,
  62. bs.create_by,
  63. bs.update_time,
  64. bs.update_by,
  65. bs.valid,
  66. bb.brand_name as brand_name,
  67. bb1.brand_name as sub_brand_name
  68. FROM `base_sku` bs
  69. LEFT JOIN base_brand bb on bs.brand_code = bb.brand_code
  70. LEFT JOIN base_brand bb1 on bs.sub_brand_code = bb1.brand_code
  71. where bs.id = #{id} and bs.is_delete = 0
  72. </select>-->
  73. </mapper>