wms/nflg-wms-repository/src/main/resources/mapper/AdvertisementMapper.xml

20 lines
904 B
XML
Raw Normal View History

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.nflg.wms.repository.mapper.AdvertisementMapper">
<select id="getByType" resultType="com.nflg.wms.repository.entity.Advertisement">
SELECT ad.*
FROM qms_advertisement ad
INNER JOIN dictionary_item di1 ON ad.type = di1.id
INNER JOIN dictionary_item di2 ON ad.position = di2.id
where di1.code = #{type} AND di2.code=#{position} and ad.enable
</select>
<select id="getList" resultType="com.nflg.wms.common.pojo.vo.AdvertisementListVO">
SELECT ad.*,di1.value AS "typeName",di2.value AS "positionName"
FROM qms_advertisement ad
INNER JOIN dictionary_item di1 ON ad.type=di1.id
INNER JOIN dictionary_item di2 ON ad.position=di2.id
</select>
</mapper>