| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?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.zhongzheng.modules.exam.mapper.ExamApplyGoodsMapper">
- <resultMap type="com.zhongzheng.modules.exam.domain.ExamApplyGoods" id="ExamApplyGoodsResult">
- <result property="id" column="id"/>
- <result property="applyId" column="apply_id"/>
- <result property="createTime" column="create_time"/>
- <result property="updateTime" column="update_time"/>
- <result property="goodsId" column="goods_id"/>
- </resultMap>
- <resultMap type="com.zhongzheng.modules.exam.vo.ExamApplyGoodsVo" id="ExamApplyGoodsVoResult">
- <result property="goodsName" column="goods_name"/>
- <result property="code" column="code"/>
- <result property="goodsId" column="goods_id"/>
- </resultMap>
- <select id="listGoods" parameterType="com.zhongzheng.modules.exam.bo.ExamApplyGoodsQueryBo" resultMap="ExamApplyGoodsVoResult">
- SELECT
- g.goods_name,
- g.`code`
- FROM
- exam_apply_goods eg
- LEFT JOIN goods g ON eg.goods_id = g.goods_id
- WHERE
- 1=1
- AND g.STATUS IN ( 1 )
- AND g.goods_type = 1
- <if test="applyId != null and applyId != ''">
- and eg.apply_id = #{applyId}
- </if>
- <if test="subjectId != null and subjectId >0">
- AND (SELECT count(*) from goods_course gc LEFT JOIN course c ON gc.course_id = c.course_id where gc.goods_id = g.goods_id and c.`status` = 1
- AND c.subject_id = #{subjectId}) >0
- </if>
- <if test="businessId != null and businessId != ''">
- AND g.business_id = #{businessId}
- </if>
- <if test="searchKey != null and searchKey != ''">
- and (g.goods_name like concat('%', #{searchKey}, '%'))
- </if>
- <if test="standPrice != null and standPrice != ''">
- AND g.stand_price = #{standPrice}
- </if>
- </select>
- </mapper>
|