PositionMapper.xml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536
  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.example.position.infrastructure.mapper.PositionMapper">
  4. <resultMap id="BaseResultMap" type="com.example.position.domain.entity.Position">
  5. <id column="ID" property="id"/>
  6. <result column="POSITION_CODE" property="positionCode"/>
  7. <result column="POSITION_NAME" property="positionName"/>
  8. <result column="POSITION_TYPE" property="positionType"/>
  9. <result column="DIRECTION" property="direction"/>
  10. <result column="QUANTITY" property="quantity"/>
  11. <result column="PRICE" property="price"/>
  12. <result column="MARKET_VALUE" property="marketValue"/>
  13. <result column="ACCOUNT_CODE" property="accountCode"/>
  14. <result column="PRODUCT_CODE" property="productCode"/>
  15. <result column="STATUS" property="status"/>
  16. <result column="VERSION" property="version"/>
  17. <result column="DELETED" property="deleted"/>
  18. <result column="CREATE_TIME" property="createTime"/>
  19. <result column="UPDATE_TIME" property="updateTime"/>
  20. </resultMap>
  21. <sql id="Base_Column_List">
  22. ID, POSITION_CODE, POSITION_NAME, POSITION_TYPE, DIRECTION,
  23. QUANTITY, PRICE, MARKET_VALUE, ACCOUNT_CODE, PRODUCT_CODE,
  24. STATUS, VERSION, DELETED, CREATE_TIME, UPDATE_TIME
  25. </sql>
  26. <select id="findByCode" resultMap="BaseResultMap">
  27. SELECT <include refid="Base_Column_List"/>
  28. FROM T_POSITION
  29. WHERE POSITION_CODE = #{positionCode}
  30. AND DELETED = 0
  31. </select>
  32. </mapper>