forked from kidgrow-microservices-platform

luliqiang
2020-12-08 ea9f73babda708e281f08f82aa099a0a128a24d5
kidgrow-business/kidgrow-opration-center/kidgrow-opration-center-biz/src/main/resources/mapper/ProductOrderRecordMapper.xml
@@ -136,7 +136,7 @@
                            </if>
                            <if test="!itemto.flag">
                                or ( is_del = 0 and enabled=1) <include refid="where_condition"></include>
                                or ( DE.is_del = 0 and DE.enabled=1) <include refid="where_condition"></include>
                            </if>
                        </when>
                        <when test="inx==2">
@@ -144,48 +144,48 @@
                                AND
                                <foreach item="itemtoto" collection="itemto.object" separator="or" open="(" close=")"
                                         index="">
                                    create_user_org_code = #{itemtoto.orgCode}
                                    DE.create_user_org_code = #{itemtoto.orgCode}
                                </foreach>
                            </if>
                            <if test="!itemto.flag">
                                or (
                                <foreach item="itemtoto" collection="itemto.object" separator="or" open="(" close=")"
                                         index="">
                                    create_user_org_code = #{itemtoto.orgCode}
                                    DE.create_user_org_code = #{itemtoto.orgCode}
                                </foreach>
                                and is_del = 0 and enabled=1  <include refid="where_condition"></include>
                                and DE.is_del = 0 and DE.enabled=1  <include refid="where_condition"></include>
                                )
                            </if>
                        </when>
                        <when test="inx == 3">
                            <if test="itemto.flag">
                                AND
                                create_user_org_code = #{itemto.object}
                                DE.create_user_org_code = #{itemto.object}
                            </if>
                            <if test="!itemto.flag">
                                or (create_user_org_code = #{itemto.object} and is_del = 0 and enabled=1) <include refid="where_condition"></include>
                                or (DE.create_user_org_code = #{itemto.object} and DE.is_del = 0 and DE.enabled=1) <include refid="where_condition"></include>
                            </if>
                        </when>
                        <when test="inx == 4">
                            <if test="itemto.flag">
                                AND
                                create_user_org_code like '${itemto.object}%'
                                DE.create_user_org_code like '${itemto.object}%'
                            </if>
                            <if test="!itemto.flag">
                                or (create_user_org_code like '${itemto.object}%' and is_del = 0 and enabled=1) <include refid="where_condition"></include>
                                or (DE.create_user_org_code like '${itemto.object}%' and DE.is_del = 0 and DE.enabled=1) <include refid="where_condition"></include>
                            </if>
                        </when>
                        <when test="inx == 5">
                            <if test="itemto.flag">
                                AND
                                create_user_id = #{itemto.object}
                                DE.create_user_id = #{itemto.object}
                            </if>
                            <if test="!itemto.flag">
                                or (create_user_id = #{itemto.object} and is_del = 0 and enabled=1) <include refid="where_condition"></include>
                                or (DE.create_user_id = #{itemto.object} and DE.is_del = 0 and DE.enabled=1) <include refid="where_condition"></include>
                            </if>
                        </when>
                        <otherwise>
                            AND id is null
                            AND DE.id is null
                        </otherwise>
                    </choose>
                </foreach>
@@ -215,7 +215,10 @@
        FROM
        product_order_record DE
        LEFT JOIN product_order PRO ON DE.order_id = PRO.id
        <include refid="wherelimit"/>
        <where>
            <include refid="where_condition"/>
        </where>
        order by DE.id desc
    </select>
    <select id="groupProductDetail" resultType="com.kidgrow.oprationcenter.vo.GroupProductDetail">