| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- <?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.ExamApplyMapper">
- <resultMap type="com.zhongzheng.modules.exam.domain.ExamApply" id="ExamApplyResult">
- <result property="applyId" column="exam_apply_id"/>
- <result property="applyUrl" column="apply_url"/>
- <result property="applyName" column="apply_name"/>
- <result property="applyIntroduce" column="apply_introduce"/>
- <result property="applyStatus" column="apply_status"/>
- <result property="applyStartTime" column="apply_start_time"/>
- <result property="applyEndTime" column="apply_end_time"/>
- <result property="createTime" column="create_time"/>
- <result property="updateTime" column="update_time"/>
- <result property="status" column="status"/>
- </resultMap>
- <resultMap type="com.zhongzheng.modules.exam.vo.ExamNumberGoodsVo" id="ExamNumberGoodsVoResult">
- <result property="id" column="id"/>
- <result property="examNumberId" column="exam_number_id"/>
- <result property="goodsId" column="goods_id"/>
- <result property="goodsName" column="goods_name"/>
- <result property="code" column="code"/>
- <result property="standPrice" column="stand_price"/>
- <result property="goodsStatus" column="goods_status"/>
- </resultMap>
- <select id="listGoods" parameterType="com.zhongzheng.modules.exam.bo.ExamNumberQueryBo" resultMap="ExamNumberGoodsVoResult">
- SELECT
- goods_id,
- goods_name,
- CODE,
- stand_price,
- (case WHEN (SELECT COUNT(ea.apply_id) FROM exam_apply ea LEFT JOIN exam_apply_goods eag on ea.apply_id =eag.apply_id where 1=1 and eag.goods_id = g.goods_id and ea.status =1) >0 then 0 ELSE 1 end) as goods_status
- FROM
- goods g
- WHERE
- 1 = 1
- and g.status in(1)
- <if test="businessId != null and businessId != ''">
- and g.business_id = #{businessId}
- </if>
- <if test="goodsId != null and goodsId != ''">
- and g.goods_id = #{goodsId}
- </if>
- <if test="projectId != null and projectId != ''">
- and g.project_id = #{projectId}
- </if>
- <if test="goodsType != null and goodsType != ''">
- and g.goods_type = #{goodsType}
- </if>
- </select>
- <select id="countGoods" parameterType="long" resultType="long">
- SELECT
- eag.goods_id
- FROM
- exam_apply ea
- LEFT JOIN exam_apply_goods eag ON ea.apply_id = eag.apply_id where ea.apply_id =#{applyId}
- and (SELECT COUNT(eay.apply_id) FROM exam_apply eay LEFT JOIN exam_apply_goods eags ON eay.apply_id = eags.apply_id where eags.goods_id = eag.goods_id and eags.apply_id != eag.apply_id and eay.status =1) > 0
- </select>
- <select id="examNumberGoodsVos" parameterType="long" resultMap="ExamNumberGoodsVoResult">
- SELECT
- g.goods_id,
- g.goods_name,
- g.CODE,
- g.stand_price
- FROM
- goods g
- LEFT JOIN exam_apply_goods eag ON g.goods_id = eag.goods_id
- WHERE
- 1 = 1
- AND g.STATUS IN ( 1 )
- AND eag.apply_id =#{applyId}
- </select>
- </mapper>
|